
Arcom Embedded Linux Technical Manual Secure Shell (SSH)
As well as logging in to a remote machine, ssh can run a command on a remote
machine without the need to login and run it manually. To do this, append the command
to the ssh command line. For example, to examine the contents of the /bin/ folder on a
remote system you might enter:
When you use ssh to run a remote command, quote shell meta characters that
you want to be passed to the remote system rather than processed locally.
The scp command
The scp command is similar to the regular cp command, except that it uses the SSH
protocol and allows for the source or destination file to be located on a remote system.
You can specify a remote file as follows:
user@host:file
The user@host part is the same as for the ssh command, described in the previous
section. If you don’t specify a file, or you give a relative path (i.e. one which doesn’t
start with /), the default is the remote user’s home folder. If you forget the colon (:), scp
will copy to or from a local file named user@host. This is rarely required.
For example, the following command copies ‘my-file’ to /home/arcom on the remote
system ael.example.net:
The following command copies the same file to /etc/ on the remote host:
To retrieve a remote file, reverse the order of the operands. For example, the following
retrieves /home/arcom/my-file from the remote system:
The sftp command
The sftp command behaves like the regular ftp command, except that it uses the SSH
protocol to provide the strong authentication and encryption that regular FTP lacks. You
can specify a user and hostname using the user@host syntax described in the
previous section, for example:
© 2006 Arcom Issue G 26
Comentarios a estos manuales