Saturday, December 8, 2007

Using lftp in copying files between two servers in ssh

LFTP is sophisticated ftp/http client, file transfer program supporting a number of network protocols. It is very useful and I've been always using this. There is this case where I need to login on one server through ssh before I will connect to this server and this has helped me a lot.

To connect to a server type :
lftp -u [username],[password] [servername]

Example : lftp -u username,password example.com

Once you are connected, you can do basic commands like "cd" to change directories and "ls" to list files and subdirectories.

To download a file, go to the directory where you want to download the file then connect to the other server using lftp. Go to the directory where the file you want to copy is located then type :
get [filename]

Example : get myfile.txt

To upload a file, go to the directory where the file is located then connect to the other server using lftp. Go to the directory where you want to upload the file then type :
put [filename]

Example : put myfile.txt

Easy isn't it? And it will help you a lot too. Try it out! :)

No comments: