Friday, January 18, 2013

SFTP Command

Graphical SFTP clients


Two SFTP clients, CyberDuck
(for Mac OS X) and WinSCP (for Windows), are available for free download.

Graphical SFTP clients simplify file transfers by allowing you to drag and drop icons
from one window to another. Each icon represents a file or directory, and each
window represents a computer's file system. When you open the program, you specify
the name of the remote host to which you want to connect (e.g., www.mysecuredomain.com), and then authenticate with your username and password for
that host.

SPTP is very useful if you have two server in different location and you want to
migrate some data from one server to the other without downloading and then
uploading. In this case you just need to ssh to the source host then sftp to the
remote and you can then copy file from the source host to the remote host.


Command-line SFTP
You can use SFTP from the command line on Unix and Mac OS X computers. To start an
SFTP session, at the command prompt, enter:

sftp username@host
For example, if your username is bigbrother, to connect to your account on the host
iswatchingyou.com, enter:

sftp bigbrother@iswatchingyou.com
Enter your password when prompted.


Some standard commands for command-line SFTP include:

cd Change the directory on the remote computer.
chmod Change the permissions of files on the remote computer.
chown Change the owner of files on the remote computer.
exit (or quit) Close the connection to the remote computer and exit SFTP.
get Copy a file from the remote computer to the local computer.
help (or ?) Get help on the use of SFTP commands.
lcd Change the directory on the local computer.
lls List the contents of the current directory on the local computer.
lmkdir Create a directory on the local computer.
ln (or symlink) Create a symbolic link for a file on the remote computer.
lpwd Show the current directory (present working directory) on the local computer.
ls (or dir) List the contents of the current directory on the remote computer.
lumask Change the local umask value.
mkdir Create a directory on the remote computer.
put Copy a file from the local computer to the remote computer.
pwd Show the current directory (present working directory) on the remote computer.
rename Rename a file on the remote computer.
rm Delete a file on the remote computer.
rmdir Remove a directory on the remote computer (the directory usually has to be
empty).
version Display the SFTP version.
! Exit to the Unix shell prompt, where you can enter commands. To get back to SFTP,
enter exit. If you combine ! with a command (e.g., !pwd), SFTP will execute the
command without dropping you to the Unix prompt.

No comments: