Welcome to WebmasterWorld Guest from 23.22.182.29

Forum Moderators: bakedjake

Message Too Old, No Replies

How can I get a file from a server via SSH?

     
5:11 pm on Feb 3, 2011 (gmt 0)

Junior Member

5+ Year Member

joined:Dec 2, 2008
posts:64
votes: 0


There is a PHP file on a server that I need to save to my local machine. How can I get this without using an FTP client, but through PuTTY or something else?

I have installed vsftp on the server but I can't connect with an FTP client for some reason. I need the file urgently, so while I work on figuring out why I can't connect via FTP, how can I get the file some other way?
11:25 am on Feb 4, 2011 (gmt 0)

Junior Member

5+ Year Member

joined:May 25, 2006
posts: 182
votes: 0


Could work this way:

Log in to your server via ssh and then copy it via scp to your local machine:

'scp path_to_file local_username@local_ip_address:/path_to_file'
12:13 pm on Feb 4, 2011 (gmt 0)

Junior Member

5+ Year Member

joined:Dec 2, 2008
posts:64
votes: 0


I am getting:

ssh: connect to host 192.168.47.1 port 22: Connection timed out
lost connection
2:48 pm on Feb 4, 2011 (gmt 0)

Junior Member

5+ Year Member

joined:Dec 2, 2008
posts:64
votes: 0


I ended up using PSCP and it worked.
10:59 am on Feb 7, 2011 (gmt 0)

Senior Member from LK 

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Nov 16, 2005
posts:2415
votes: 16


I do this all the time using SFTP

Because I use Linux I just drag and drop using the Konqueror file manager, but you should be able to find a reasonable GUI SFTP client on any platform.

There is no real reason to use FTP any more. Sending passwords in plain text is not good security, and FTP does nothing to verify that you are connected to the server you wanted to be connected to either.