Chapter 18. OpenSSH
This will transfer the local file shadowman to /home/username/shadowman on
penguin.example.net. Alternately, you can leave off the final shadowman in the scp command.
The general syntax to transfer a remote file to the local system is as follows:
scp username@tohostname:<remotefile> <newlocalfile>
The <remotefile> specifies the source including path, and <newlocalfile> specifies the
destination including path.
Multiple files can be specified as the source files. For example, to transfer the contents of the directory
downloads/ to an existing directory called uploads/ on the remote machine penguin.example.net,
type the following at a shell prompt:
scp downloads/* username@penguin.example.net:uploads/
18.6.3. Using the sftp Command
The sftp utility can be used to open a secure, interactive FTP session. It is similar to ftp except that
it uses a secure, encrypted connection. The general syntax is sftp username@hostname.com.
Once authenticated, you can use a set of commands similar to those used by FTP. Refer to the sftp
man page for a list of these commands. To read the man page, execute the command man sftp at a
shell prompt. The sftp utility is only available in OpenSSH version 2.5.0p1 and higher.
18.7. More Than a Secure Shell
A secure command line interface is just the beginning of the many ways SSH can be used. Given the
proper amount of bandwidth, X11 sessions can be directed over an SSH channel. Or, by using TCP/
IP forwarding, previously insecure port connections between systems can be mapped to specific SSH
channels.
18.7.1. X11 Forwarding
Opening an X11 session over an SSH connection is as easy as connecting to the SSH server using
the -Y option and running an X program on a local machine.
ssh -Y <user>@example.com
When an X program is run from the secure shell prompt, the SSH client and server create a new
secure channel, and the X program data is sent over that channel to the client machine transparently.
X11 forwarding can be very useful. For example, X11 forwarding can be used to create a secure,
interactive session of the Printer Configuration Tool. To do this, connect to the server using ssh and
type:
system-config-printer &
After supplying the root password for the server, the Printer Configuration Tool appears and allows
the remote user to safely configure printing on the remote system.
232
Need help?
Do you have a question about the ENTERPRISE LINUX 5 - DEPLOYMENT and is the answer not in the manual?
Questions and answers