SFTP is SSH File Transfer Protocol. This works over ssh protocol for secure file transfer between two remote systems. The latest OpenSSH servers have default configured SFTP server for you.
Connect to SFTP
Use sftp command line utility to connect remote sftp system. You need the sftp user and hostname or IP address of the remote host.
Navigate and View Files
Navigation in directories on SFTP is as simple as the local system. Use ‘pwd’ command to check the current working directory.
Then use ‘ls’ command to list all files and directories in the current directory.
To navigate to other directories use ‘cd’ command followed by destination directory.
Use ‘cd ..’ to navigate to the parent directory.
Upload files to SFTP
Now, I need to upload some files under uploads directory. So first navigate to destination directory.
Use ‘put’ command to upload README.md from local system to remote sftp directory.
You can also provide the absolute path of the local file and remote directory without navigating directories.
Download Files from SFTP
To download files from remote sftp directory use ‘get’ command. For example to download REMOTE_FILE.md from remote system to the current local directory.
Similarly, you can provide an absolute path to download files.
Exit from SFTP
Simply say bye to your remote SFTP server. This will disconnect the SFTP connection and return to your local shell.
Alternatively, you can also use one of the following options to quite from the SFTP session. These all 3 do the same work.
No comments:
Post a Comment