- This topic is empty.
- AuthorPosts
-
May 31, 2015 at 3:07 am #9285
abctest483MemberI am having trouble copying files from a remote server using SSH. Using PuTTY I log in to the server using SSH. Once I find the file I would like to copy over to my computer, I use the command:
scp username@host.com:/dir/of/file.txt \local\dir\It looks like it was successful, but it only ends up creating a new folder labeled ‘localdir’ in the remote directory
/dir/of/.How can I copy the file to my local computer over SSH?
May 31, 2015 at 3:13 am #9288
abctest483MemberYou need to name the file in both directory paths.
scp username@host.com:/dir/of/file.txt \local\dir\file.txtMay 31, 2015 at 3:20 am #9286
abctest483Memberthat scp command must be issued on the local command-line, for putty the command is pscp.
C:\something> pscp username@host.com:/dir/of/file.txt \local\dir\May 31, 2015 at 3:23 am #9290
abctest483MemberIt depends on what your local OS is.
If your local OS is Unix-like, then try:
scp username@remoteHost:/remote/dir/file.txt /local/dir/If your local OS is Windows ,then you should use
pscp.exeutility.
For example, below command will download file.txt from remote toD:disk of local machine.pscp.exe username@remoteHost:/remote/dir/file.txt d:\It seems your Local OS is Unix, so try the former one.
For those who don’t know what
pscp.exeis and don’t know where it is, you can always go toputtyofficial website to download it. And then open a CMD prompt, go to the pscp.exe directory where you put it. Then execute the command as provided aboveEDIT
if you are using Windows OS above Windows 10, then you can use
scpdirectly from its terminal, just like how Unix-like OS does.
Thanks to @gijswijs @jaunt @icanfathomMay 31, 2015 at 3:25 am #9289
abctest483MemberYour question is a bit confusing, but I am assuming – you are first doing ‘ssh’ to find out which files or rather specifically directories are there and then again on your local computer, you are trying to scp ‘all’ files in that directory to local path. you should simply do
scp -r.So here in your case it’d be something like
local> scp -r username@host.com:/path/to/dir local/pathIf youare using some other executable that provides ‘scp like functionality’, refer to it’s manual for recursively copying files.
May 31, 2015 at 4:03 am #9287
AnonymousInactiveMake sure the scp command is available on both sides – both on the
client and on the server.BOTH Server and Client, otherwise you will encounter this kind of (weird)error message on your client:
scp: command not foundor something similar even though though you have it all configured locally. - AuthorPosts
- You must be logged in to reply to this topic.