Monday, June 9, 2008

Using SSH

SSH is a program to log into another computer over a network, to execute commands in a remote machine, and to move files from one machine to another. It provides strong authentication and secure communications over insecure channels. SSH is most useful when logging into a UNIX machine from another machine where the traditional telnet and rlogin programs would not provide password and session encryption.

Now we'll take a look at some basic SSH commands in networking.
To login to a remote machine running sshd server you can use the any of the following formats.

# ssh -l remote_user host_name_or_ip
# ssh remote_user@host_name_or_ip
e.g.
# ssh -l root 192.248.16.100
# ssh bud@server.cmb.ac.lk

To execute a command on the remote machine without logging in explicitly you can use,
# ssh -l remote_user host_name_or_ip remote_command
e.g.
# ssh -l bud@192.248.16.100 /usr/bin/x11/xclock
It starts the xclock application in the remote machine.

To ftp securely you can use sftp.
e.g
# sftp bud@192.248.16.100

sftp> cd downloads - Used to change directory
sftp>mput *.rpm - Used to upload multiple files
sftp>mget httpd* - Used to download multiple files
sftp>help - See a list of commands

To copy files from one host to another try
# scp [-r] source user@remote_host:target
e.g.
# scp bud@192.248.16.100:/etc/lilo.conf /tmp

Still there is SSH server and client configuration and do you knw how to configure passwordless SSH login?
http://www.keepandshare.com/doc/view.php?id=624904&da=y


No comments: