Installation guide
Chapter 9. OpenSSH 99
9.3.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
using 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.
9.3.4. Generating Key Pairs
If you do not want to enter your password every time you use ssh, scp, or sftp to connect
to a remote machine, you can generate an authorization key pair.
Keys must be generated for each user. To generate keys for a user, follow the following steps
as the user who wants to connect to remote machines. If you complete the following steps as
root, only root will be able to use the keys.
Important
Starting with OpenSSH version 3.0, ~/.ssh/authorized_keys2, ~/.ssh/known_hosts2, and
/etc/ssh_known_hosts2 are obsolete. SSH Protocol 1 and 2 share the ~/.ssh/authorized_keys,
~/.ssh/known_hosts, and /etc/ssh/ssh_known_hosts files.
9.3.4.1. Generating a DSA Key Pair for Version 2
Use the following steps to generate a DSA key pair for version 2 of the SSH Protocol.
1. To generate a DSA key pair to work with version 2 of the protocol, type the following
command at a shell prompt:
ssh-keygen -t dsa
Accept the default file location of ~/.ssh/id_dsa. Enter a passphrase different from
your account password and confirm it by entering it again.
1
Tip
A passphrase is a string of words and characters used to authenticate a user. Passphrases
differ from passwords in that you can use spaces or tabs in the passphrase. Passphrases are
generally longer than passwords because they are usually phrases instead of just a word.
The public key is written to ~/.ssh/id_dsa.pub. The private key is written to
~/.ssh/id_dsa. It is important never to give anyone the private key.
1. The ~ stands for the home directory of the currently logged in user. See the Official Red Hat Linux
Getting Started Guide for more details.