From e02c74be427f3743d5764889a233785848dc1d70 Mon Sep 17 00:00:00 2001 From: Klaatu Date: Fri, 22 Jun 2012 00:05:26 -0400 Subject: Corrected some docbook markup. Added some chapter and section id tags for xref use later on. Wrote a page or two about mailx because there was only one paragraph on it so far. --- chapter_16.xml | 279 +++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 202 insertions(+), 77 deletions(-) diff --git a/chapter_16.xml b/chapter_16.xml index 9c92b31..484ede3 100644 --- a/chapter_16.xml +++ b/chapter_16.xml @@ -2,7 +2,7 @@ - + Basic Networking Utilities @@ -12,7 +12,7 @@ correctly? And just what do you do now that it's setup? Well this chapter is for you. -
+
Network Diagnostic Tools @@ -25,7 +25,7 @@ graphical front-ends, but we're going to deal almost exclusively with command-line tools for now. -
+
ping @@ -48,7 +48,7 @@ functioning properly, but still not send replies. -darkstar:~# ping -c 3 www.slackware.com +darkstar:~# ping -c 3 www.slackware.com 64 bytes from slackware.com (64.57.102.34): icmp_seq=1 ttl=47 time=87.1 ms 64 bytes from slackware.com (64.57.102.34): icmp_seq=2 ttl=47 time=86.2 ms 64 bytes from slackware.com (64.57.102.34): icmp_seq=3 ttl=47 time=86.7 ms @@ -60,7 +60,7 @@ rtt min/avg/max/mdev = 86.282/86.718/87.127/0.345 ms
-
+
traceroute @@ -77,7 +77,7 @@ picture when using it. Still, it remains a handy tool for network troubleshooting. -darkstar:~# traceroute www.slackware.com +darkstar:~# traceroute www.slackware.com traceroute to slackware.com (64.57.102.34), 30 hops max, 46 byte packets 1 gw.ctsmacon.com (192.168.1.254) 1.468 ms 2.045 ms 1.387 ms @@ -101,7 +101,7 @@ packets
-
+
telnet @@ -127,26 +127,26 @@ pages or check your e-mail. Simply inform all set. -darkstar:~# telnet www.slackware.com 80 +darkstar:~$ telnet www.slackware.com 80 Trying 64.57.102.34... Connected to www.slackware.com. Escape character is '^]'. -HEAD / HTTP/1.1 +HEAD / HTTP/1.1 Host: www.slackware.com -HTTP/1.1 200 OK +HTTP/1.1 200 OK Date: Thu, 04 Feb 2010 18:01:35 GMT -Server: Apache/1.3.27 (Unix) PHP/4.3.1 +Server: Apache/1.3.27 (Unix) PHP/4.3.1 Last-Modified: Fri, 28 Aug 2009 01:30:27 GMT ETag: "61dc2-5374-4a973333" Accept-Ranges: bytes Content-Length: 21364 -Content-Type: text/html +Content-Type: text/html
-
+
ssh @@ -169,9 +169,9 @@ because it is possible that some one is attempting to hijack the connection using what is known as a man-in-the-middle attack. -darkstar:~# ssh alan@slackware.com +darkstar:~# ssh alan@slackware.com alan@slackware.com's password: secret -alan@slackware.com:~$ +alan@slackware.com:~$ @@ -202,17 +202,17 @@ and change the manner in which it is displayed, but that is best explained by the man page and other reference material. -darkstar:~# tcpdump -i wlan0 +darkstar:~# tcpdump -i wlan0 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on wlan0, link-type EN10MB (Ethernet), capture size 96 bytes -13:22:28.221985 IP gw.ctsmacon.com.microsoft-ds > 192.168.1.198.59387: +13:22:28.221985 IP gw.ctsmacon.com.microsoft-ds > 192.168.1.198.59387: Flags [P.], ack 838190560, win 3079, options [nop,nop,TS val 1382697489 ecr 339048583], length 164WARNING: Short packet. Try increasing the snap length by 140 SMB PACKET: SMBtrans2 (REPLY) -13:22:28.222392 IP 192.168.1.198.59387 > gw.ctsmacon.com.microsoft-ds: +13:22:28.222392 IP 192.168.1.198.59387 > gw.ctsmacon.com.microsoft-ds: Flags [P.], ack 164, win 775, options [nop,nop,TS val 339048667 ecr 1382697489], length 134WARNING: Short packet. Try increasing the snap length by 110 @@ -221,7 +221,7 @@ SMB PACKET: SMBtrans2 (REQUEST)
-
+
nmap @@ -244,13 +244,13 @@ you like. -In order to "ping" hosts, you'll have to use the -sP +In order to "ping" hosts, you'll have to use the -sP argument. The following command instructs -nmap to "ping" www.slackware.com and the 16 +nmap to "ping" www.slackware.com and the 16 IP addresses starting at 72.168.24.0 and ending at 72.168.24.15. -darkstar:~# nmap -sP www.slackware.com 72.168.24.0/28 +darkstar:~# nmap -sP www.slackware.com 72.168.24.0/28 @@ -262,25 +262,27 @@ hosts specified. There are also options to make scanning to return results quicker or fool intrusion detection services. For a full discussion, you should refer to the rather exhaustive man page. The following three commands perform a regular -port scan, a SYN scan, and a "Christmas tree" scan. +port scan, a SYN scan, and a "Christmas tree" scan. -darkstar:~# nmap www.example.com -darkstar:~# nmap -sS www.example.com -darkstar:~# nmap -sX www.example.com +darkstar:~# nmap www.example.com +darkstar:~# nmap -sS www.example.com +darkstar:~# nmap -sX www.example.com - -Be warned! Some Internet Service Providers frown heavily on port -scanning and may take measures to prevent you from doing it. -nmap and applications like it are best used -on your own systems for maintenance and security purposes, not as -general purpose Internet scanners. - + + + Be warned! Some Internet Service Providers frown heavily on port + scanning and may take measures to prevent you from doing it. + nmap and applications like it are best + used on your own systems for maintenance and security purposes, + not as general purpose Internet scanners. + +
-
+
host @@ -291,7 +293,7 @@ this is run, your computer will perform a few common DNS lookups and return the results. -darkstar:~# host www.slackware.com +darkstar:~# host www.slackware.com www.slackware.com is an alias for slackware.com. slackware.com has address 64.57.102.34 slackware.com mail is handled by 1 mail-mx.cwo.com. @@ -312,30 +314,30 @@ far too many command-line options and lookup types to go into depth here, but the man page lists all the common use cases. -darkstar:~# dig @207.69.188.185 www.slackware.com a +darkstar:~# dig @207.69.188.185 www.slackware.com a -; <<>> DiG 9.4.3-P4 <<>> @207.69.188.185 www.slackware.com a -; (1 server found) -;; global options: printcmd -;; Got answer: -;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57965 -;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 0 +; <<>> DiG 9.4.3-P4 <<>> @207.69.188.185 www.slackware.com a +; (1 server found) +;; global options: printcmd +;; Got answer: +;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57965 +;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 0 -;; QUESTION SECTION: -;www.slackware.com. IN A +;; QUESTION SECTION: +;www.slackware.com. IN A -;; ANSWER SECTION: +;; ANSWER SECTION: www.slackware.com. 86400 IN CNAME slackware.com. slackware.com. 86400 IN A 64.57.102.34 -;; AUTHORITY SECTION: +;; AUTHORITY SECTION: slackware.com. 86400 IN NS ns2.cwo.com. slackware.com. 86400 IN NS ns1.cwo.com. -;; Query time: 348 msec -;; SERVER: 207.69.188.185#53(207.69.188.185) -;; WHEN: Sat Jul 3 16:25:10 2010 -;; MSG SIZE rcvd: 105 +;; Query time: 348 msec +;; SERVER: 207.69.188.185#53(207.69.188.185) +;; WHEN: Sat Jul 3 16:25:10 2010 +;; MSG SIZE rcvd: 105 @@ -344,7 +346,7 @@ Let's take a took at the command-line options used above. The @207.69.188.185 argument tells dig what DNS server to query. If it is not specified, dig will simply use whatever -servers are listed in /etc/resolv.conf. The +servers are listed in /etc/resolv.conf. The a argument at the end is the type of DNS record to lookup. In this case we looked for an "A" record which returned an IPv4 address. @@ -364,16 +366,16 @@ it can be a useful tool for keeping track of your friends and co-workers. -darkstar:~$ finger alan@cardinal.lizella.net +darkstar:~# finger alan@cardinal.lizella.net [cardinal.lizella.net] Login: alan Name: Alan Hicks -Directory: /home/alan Shell: /bin/bash +Directory: /home/alan Shell: /bin/bash Office: 478 808 9919, 478 935 8133 -On since Wed Apr 13 17:43 (UTC) on pts/9 from +On since Wed Apr 13 17:43 (UTC) on pts/9 from 75-150-12-113-atlanta.hfc.comcastbusiness.net 32 minutes 24 seconds idle (messages off) -On since Wed Apr 13 17:45 (UTC) on pts/10 from :pts/9:S.0 +On since Wed Apr 13 17:45 (UTC) on pts/10 from :pts/9:S.0 48 minutes 56 seconds idle Mail forwarded to alan@lizella.net No mail. @@ -384,16 +386,19 @@ No Plan.
-
Web Browsers +
+Web Browsers Slackware includes a variety of web browsers. If you're using a -graphical desktop, you'll find Firefox, Seamonkey, and others you may -already be familiar with, but what about console access? Fortunately, -there are a number of capable web browsers here as well. +graphical desktop, you'll find Firefox, +Seamonkey, and others you may already be +familiar with, but what about console access? Fortunately, there are a +number of capable web browsers here as well. -
lynx +
+ lynx The oldest console-based web browser included with Slackware is @@ -412,7 +417,8 @@ console, which can then be piped to other programs.
-
links + -
+
Mail Clients
pine @@ -480,12 +486,16 @@ user-friendly. pine was created by the University of Washington and carries with it both a trademark and a copyright license that are difficult to work with. Thankfully back in 2005, the university saw fit to re-write it without the trademark and -with a more open license, so alpine(1) was -born. This is the pine-clone distributed with Slackware. To start using -it, simply type pine at the command line. +with a more open license, so alpine(1), the +pine-clone distributed with Slackware, was born. + + + +To start using alpine, +simply type pine at the command line. Using it is very simple due to its menu-driven system as well as the command referance neatly located at the bottom of the screen. See for -yourself. +yourself: @@ -516,7 +526,8 @@ O OTHER CMDS > [ListFldrs] N NextCmd K KBLock
-
mutt +
+ mutt Some people don't like pine. Some people @@ -560,7 +571,8 @@ for that, muttrc(5). You might want to read up on it.
-
mailx +
+ mailx So those are great and everything, but what if you just want a mail @@ -568,11 +580,124 @@ client that isn't menu-driven? Thankfully mailx is here to save you. + + mailx is based on the Berkeley Mail + application, with a mail command + appearing as early as Version 1 of AT&T's UNIX. It can be + used either interactively or non-interactively. + + + + To launch mailx, type + mail at a shell prompt. + mailx reads mail from your computer's + mail spool and displays the usual combination of sender, subject, + status, and size in a list, leaving the user at an interactive + prompt. In fact, it might look familiar to you if you bothered + checking your mail immediately after installing Slackware and read + Pat Volkerding's greeting. + + + +root@darkstar:/home/klaatu# mail +Heirloom mailx version 12.4 7/29/08. Type ? for help. +"/var/spool/mail/root": 2 messages 2 new +>N 1 To root Thu Mar 10 23:33 52/1902 Register with the Linux counter project + N 2 To root Thu Mar 10 23:35 321/15417 Welcome to Linux (Slackware 13.37)! +? + + + + To read a message, enter the number of the message at the + prompt. This displays the message using + more, so use the RETURN + key to view the next page. Once the end of the message has been + reached, press q to return to the list view, or + RETURN to continue to the next message. + + + + To see a list of available commands, type ? at the + mail prompt; using the commands provided, + you can view the headers of mail in the spool, reply, delete, save, + and many other common email tasks. + + + + mailx is most powerful when used in + scripting. For all of the options available for + mailx, view its man page. A simple way to + send an email to someone requires only the command itself and the + destination address: + + + + darkstar:~$ mail + alan@lizella.net + + + + After the command has been issued, an interactive prompt appears for + a subject line, the message body, and the end character (a single + dot on an otherwise empty line). + + + + mailx can be used entirely without human + intervention, however. Generally, it's safe to assume that any + attribute you can define in the interactive shell for + mailx can also be defined while scripting + it or using it as one non-interactive command: + + + + darkstar:~$ mail -n -s "Test message" alan@lizella.net < ~/message.txt + + + + In this example, the contents of the file + message.txt would be sent as the message body + to the specified recipient. No interaction from the user is required. + + + + Within one's own computer (localhost) or one's own network, sending + email in this manner is entirely possible. But over the internet a + few more steps are usually required along the way. Of course, most + notably there is usually an smtp server handling the delivery of your + email. This, too, can be specified as part of your + mail command: + + + + darkstar:~$ env MAILRC=/dev/null + from="klaatu@slackermedia.info (Klaatu)" + smtp=relay.slackermedia.info mail -n -s "Test message" alan@lizella.net < ~/message.txt + + + + In this case, the MAILRC variable is set to + /dev/null in order to override any system defaults, and the + smtp server as well as the FROM: line are + defined. The rest of the command is the same as using + mailx internally within one's own + computer or network. + + + + Over all, mailx is usually viewed as a + mail client with the bare-minimum features; this is largely true, + but when you need to be able to script sending notification emails + or important update messages, it quickly becomes a lot more valuable + than a fully interactive application like + pine or mutt. + +
-
+
FTP Clients -- cgit v1.2.3