Saturday, June 25, 2016

[SFTP] Connecting to remote server for file sharing

You can use to connect remote server and easily share files between local and remote server using SFTP.

You can use SFTP with your "key" which is using to access the remote server OR just access without credentials if you don't have any

Using SFTP server:

sftp -i <key file> username@remote_hostname/ip   OR
sftp username@remote_hostname/ip

Ex:

 sftp -i dilshani.pem centos@192.***.**.71  

When you connected through SFTP server it can see the sftp server as follows:


 sftp>  

You can get files or send files secure manner.

Send files:

put <file_name> <remote_location>

 sftp> put test.text /home/centos/files  

** Note: If you are using above command, file should be located in same folder, which is going to start sftp server. Otherwise it can be give the path of file befor file name.

Get files:

get <remote_location/file_name> <local_location>

 sftp> get /home/centos/files/test.text  

** Note: you can navigate to any folder using cd command

cd <file_directory>

 sftp> cd /home/centos/files  

When you are done with file sharing, close the server with "exit" command.

 sftp> exit  


Happy Sharing :)



No comments:

Post a Comment