|Securing and Optimizing Linux: RedHat Edition -A Hands on Guide|
|Prev||Chapter 15. Software -Securities||Next|
The commands listed belows are some that we use often in our regular use, but many more exist, and you should check the man page and documentation for more details. The ssh Secure Shell command provides secure encrypted communications between two untrusted hosts over an insecure network. It is a program for logging securely into a remote machine and executing commands from there. It is a suitable replacement for insecure programs like telnet, rlogin, rcp, rdist, and rsh.
To login to a remote machine, use the command:
[[email protected]] /#ssh -l <login_name> <hostname>
Example 15-1. Remote login using ssh
[[email protected]] /#ssh -l admin www.openna.com
[email protected] password: Last login: Tue Oct 19 1999 18:13:00 -0400 from deep.openna.com No mail.
[[email protected] ]/admin$
The scp Secure Copy utility copies files from the local system to a remote system or vice versa, or even between two remote systems using the scp command. To copy files from remote to local system, use the following command:
[[email protected]] /#su admin [[email protected] /]$scp -p <[email protected]>:/dir/for/file localdir/to/filelocation
Example 15-2. scp Secure Copy utility
[[email protected] /]$ scp1 -p [email protected]:/etc/test1 /tmp
Enter passphrase for RSA key '[email protected]': test1 | 2 KB | 2.0 kB/s | ETA: 00:00:00 | 100%
To copy files from local to remote system, use the following command:
[[email protected]] /#su admin [[email protected] /]$scp -p localdir/to/filelocation <[email protected]>:/dir/for/file
Example 15-3. local to remote
[[email protected] /]$scp1 -p /usr/bin/test2 [email protected]:/var/tmp
[email protected]'s password: test2 | 7 KB | 7.9 kB/s | ETA: 00:00:00 | 100%
: The -p option indicates that the modification and access times, as well as modes of the source file, should be preserved on the copy. This is usually desirable.
Some possible uses of OpenSSH softwareare:
Replace telnet, rlogin, rsh, rdist, and rcp.
Make secure backups over the network.
Execute remote commands.
Access to corporate resources over the Internet.