Sftp

From Global Shellz Wiki
Jump to: navigation, search

sftp is a commandline tool to transfer files from localhost to shell and vice versa. If you want to share a screenshot, or move a file or folder with your work, it may do that in a fast, reliable manner.

Sftp uses the ssh protocol to move the files.

To establish a connection,

$ sftp -P 222 thewookie@{us|eu}.gshellz.org

Use your shell password to login.

Once you're in, you will be presented with a "sftp> " commandline. All available commands can be seen if you type "help"; here is a few most commonly used:

cd path                            Change remote directory to 'path'
exit                               Quit sftp
get [-Ppr] remote [local]          Download file
help                               Display this help text
lcd path                           Change local directory to 'path'
lls [ls-options [path]]            Display local directory listing
lmkdir path                        Create local directory
ln [-s] oldpath newpath            Link remote file (-s for symlink)
lpwd                               Print local working directory
ls [-1afhlnrSt] [path]             Display remote directory listing
put [-Ppr] local [remote]          Upload file
pwd                                Display remote working directory
quit                               Quit sftp

An example session may be:

localuser@laptop:~$ sftp -P 222 thewookie@eu.gshellz.org
thewookie@eu.gshellz.org's password: 
Connected to eu.gshellz.org.
sftp> ls
Maildir public_html
sftp> lcd /home/localuser/
sftp> put test
Uploading test to /home/t/thewookie/test
test                                                                                                                100%    3     0.0KB/s   00:00    
sftp> ls
Maildir public_html test
sftp> quit
localuser@laptop:~$

External links

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox