12.07.2015 Views

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

360CHAPTER 17Securing Remote Logins with OpenSSHTIPIf the path for the does not begin with a /, it is assumed that the pathis relative to the user’s home directory. For example, to transfer the fileProjectSchedule.odt to your home directory on a remote system, use the scpProjectSchedule.odt remote.example.com: command.The sftp utility can also be used to transfer files via an encrypted connection. It differsfrom scp and is similar to ftp in that it uses an interactive shell. To connect via sftp to aremote system, use the command sftp username@. Again, if no usernameis specified, the username of the current user on the client is assumed for theremote system. After authenticating correctly, the sftp> prompt is displayed, giving theuser an interactive session to the remote system (see Listing 17.3). The interactivecommands are similar to ftp. Table 17.2 lists common sftp commands.LISTING 17.3sftp SessionConnecting to fileserver.example.com...tfox@fileserver’s password:sftp>TABLE 17.2 Common sftp Commandssftp commandDescriptionpwdDisplay current remote directorylpwdDisplay current local directorycd Change to remote directorylcd Change current local directoryget Retrieve from current remote directory to currentlocal directorymget Retrieve multiple filesput Upload local file to the current remote directorymput Upload multiple local files to the current remote directorylsList files in current remote directoryexitClose connection to SSH server and exitAs you can tell, the commands are similar to ftp with a few exceptions, such as the user isnot prompted to confirm actions by default—there is no need to disable prompting withthe prompt command before using mget and mput. Hash marks can’t be displayed to showprogress, but progress in terms of percentage of total transfer, total kilobytes already transferred,transfer rate, and time remaining is automatically displayed, as in the following:/tmp/samplefile 100% 1888KB 1.8MB/s 00:01

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!