|Introduction to Basic Unix System Administration|
|<<< Previous||Unix Communication and Networking||Next >>>|
At the very basic level, any Unix system offers the ftp, which allows data transport from one host to another using plain password authentication. In order to use the FTP service, you need a username and password on both the originating host and the target host. FTP servers (main action send data to clients) usually have an anonymous or nobody account which accepts any fully qualified E-mail address as a password.
The ncftp command offers extra features to ftp, such as a nicer userinterface, filename completion, append and resume functions etc. Read the manual for more.
Below is an example using ncftp:
tille:~>ncftp sprawl NcFTP 3.0.2 (October 19, 2000) by Mike Gleason (email@example.com). Connecting to 192.168.42.1... sprawl.soti.org FTP server (Version wu-2.6.1-16) ready. Logging in... Password requested by 192.168.42.1 for user "tille". Password required for tille. Password: User tille logged in. Logged in to sprawl. Current remote directory is /home/tille. ncftp /home/tille > cd backup/ ncftp /home/tille/backup > put images-without-dir.tar.gz images-without-dir.tar.gz: 49.38 kB 1.36 MB/s ncftp /home/tille/backup > bye tille:~>
There are lots of graphical FTP clients which have the same functionality in a nice window, for those who like to point and click.
Keep in mind that a common FTP client sends your login name and password plainly visible across the network, so you are strongly advised to use only anonymous FTP when your data travels an insecure network. Read your FTP clients manual for more information.
The rcp command copies files between filesystems, but you should not use it. It uses a file .rhosts in your homedirectory, specifying which users at which hosts have access to your directory, bypassing any password authentication. When your system gets compromised, there's no end to the misery this can cause.
Use scp (included in the Secure SHell suite) to copy files from one host to another. The scp mechanism uses encryption to copy files from one host to another, and needs a correct username/password combination on the destination host. This is how it works:
scp fromuser@fromhost:frompath touser@tohost:topath
Here's a real life example:
scp -r albert@happy:/tmp/recent-downloads/ .
This will copy all files from directory /tmp/recent-downloads on the system with name "happy" to the present working directory (that's the dot in the end), and to do this, we'll connect to the remote system with userid "albert". Supposing we would like to store these files in /tmp on our own host, we'd enter
scp -r albert@happy:/tmp/recent-downloads/ /tmp/
A real life example from the backup chapter:
tille:~>scp images-without-dir.tar.gz sprawl:/tmp/ tille@sprawl's password: images-without-dir.t 100% |******************************| 50562 00:00 tille:~>
You will of course read the manual.