Miscellaneous Clients
Several other clients are included in addition tossh and scp :
sftp, anftp-like client for SSH2slogin, a link tossh, analogous to therloginprogram- Hostname links to
ssh
sftp
Thescp command is convenient and useful, but many users are already familiar with FTP (File Transfer Protocol), a more widely used technique for transferring files on the Internet.[14] sftp is a separate file-transfer tool layered on top of SSH. It was developed by SSH Communications Security and was originally available only in SSH2, but other implementations have since appeared (e.g., client support in SecureFX and server support in OpenSSH). sftp is available only in SSH2: it is implemented as an SSH2 subsystem ["Subsystems"] and thus not readily adaptable to use with SSH1.
[14]Due to the nature of the FTP protocol, FTP clients are difficult to secure using TCP port forwarding, unlike most other TCP-based clients. ["FTP Forwarding"]
sftp is advantageous for several reasons:
- It is secure, using an SSH-protected channel for data transfer.
- Multiple commands for file copying and manipulation can be invoked within a single
sftpsession, whereasscpopens a new session each time it is invoked. - It can be scripted using the familiar
ftpcommand language. - In other software applications that run an FTP client in the background, you can try substituting
sftp, thus securing the file transfers of that application.
sftp issues for your passphrase, or they might expect you to have suppressed FTP's password prompt (using a netrc file, for example).Anyone familiar with FTP will feel right at home with sftp, but sftp has some additional features of note:
- Command-line editing using GNU Emacs-like keystrokes (
Control-Bfor backward character,Control-Efor end of line, and so forth) - Regular-expression matching for filenames, as documented in the
sshregexmanpage supplied with SSH2 and found in Appendix A, "SSH2 Manpage for sshregex" - Several command-line options:
- -b filename
- Read commands from the given file instead of the terminal
- -S path
- Locate the
ssh2program using the given path - -h
- Print a help message and exit
- -V
- Print the program version number and exit
- -D module=level
- Print debugging output ["SSH2 Debug mode (module-based)"]
sftp doesn't have the separate ASCII and binary transfer modes of standard FTP, only binary. All files are transferred literally. Therefore, if you copy ASCII text files between Windows and Unix with sftp, end-of-line characters aren't translated properly. Normally, FTP's ASCII mode translates between Windows' "carriage return plus newline" and Unix's newline, for example.
slogin
slogin is an alternative name for ssh, just as rlogin is a synonym for rsh. On Unix systems, slogin is simply a symbolic link to ssh. Note that the slogin link is found in SSH1 and OpenSSH but not SSH2. We recommend using just ssh for consistency: it's found in all these implementations and is shorter to type.
Hostname Links
ssh for SSH1 and OpenSSH also mimics rlogin in another respect: support for hostname links. If you make a link to the ssh executable, and the link name isn't in the set of standard names ssh recognizes,[15] ssh has special behavior. It treats the link name as a hostname and attempts to connect to that remote host. For example, if you create a link called terpsichore.muses.org and then run it:
[15]These arersh,ssh,rlogin,slogin,ssh1,slogin1,ssh.old,slogin.old,ssh1.old,slogin1.old, andremsh.
$ ln -s /usr/local/bin/ssh terpsichore.muses.org $ terpsichore.muses.org Welcome to Terpsichore! Last login January 21st, 201 B.C. terpsichore>
It's equivalent to running:
$ ssh terpsichore.muses.org Welcome to Terpsichore! Last login January 21st, 201 B.C. terpsichore>
You can create a collection of these links for all commonly used remote hosts. Note that support for hostname links has been removed in SSH2. (We have never found them to be very useful, ourselves, but the capability does exist in SSH1 and OpenSSH.)