Datasheet
“main” (Installation and Administration) — 2004/6/25 — 13:29 — page 653 — #679
i
i
i
i
i
i
i
i
26
Security in the Network
Furthermore, ssh offers the possibility to run commands on remote sys-
tems, as known from rsh. In the following example, run the command
uptime on the host sun and create a directory with the name tmp/. The
program output is displayed on the local terminal of the host earth.
ssh otherplanet "uptime; mkdir tmp"
tux@otherplanet’s password:
1:21pm up 2:17, 9 users, load average: 0.15, 0.04, 0.02
Quotation marks are necessary here to send both instructions with one
command. It is only by doing this that the second command is executed
on sun.
26.4.3 scp — Secure Copy
scp copies files to a remote machine. It is a secure and encrypted sub-
stitute for rcp. For example, scp MyLetter.tex sun: copies the file
MyLetter.tex from the host earth to the host sun. If the user name on
earth is different than the user name on sun, specify the latter using the
username@host format. There is no -l option for this command.
After the correct password is entered, scp starts the data transfer and
shows a growing row of asterisks to simulate a progress bar. In addi-
tion, the program displays the estimated time of arrival to the right of the
progress bar. Suppress all output by giving the option -q.
scp also provides a recursive copying feature for entire directories. The
command scp -r src/ sun:backup/ copies the entire contents of the
directory src/ including all subdirectories to the backup/ directory on
the host sun. If this subdirectory does not exist yet, it is created automati-
cally.
The option -p tells scp to leave the time stamp of files unchanged. -C com-
presses the data transfer. This minimizes the data volume to transfer, but
creates a heavier burden on the processor.
26.4.4 sftp — Secure File Transfer
The sftp program can be used instead of scp for secure file transfer. During
an sftp session, you can use many of the commands known from ftp. The
sftp program may be a better choice than scp, especially when transferring
data for which the file names are unknown.
653
SUSE LINUX Enterprise Server










