How do I copy files from a Unix server to a Windows client with SSH?
Solution 1
scp
is the way that we do this. If you're using something like putty, it comes with pscp
as part of it.
I prefer pscp
over the standard scp
since it allows you to specify a password on the command line, something useful for scripting.
An example invocation from one of my scripts (details changed to protect the innocent):
pscp -pw paxpwd src.tar.gz [email protected]:/usr/pax/tmp/src.tar.gz
This copies the src.tar.gz
file from my local (Windows) directory to /usr/pax/tmp
on my pax.com
UNIX machine, using the pax/paxpwd
user and password.
Your particular use case would be satisfied by:
pscp -pw biranchipwd [email protected]:abc/xyz.txt xyz.txt
Keep in mind that placing passwords into scripts is not generally a good idea since it means anyone that breaks into your local machine can easily break into the other machine as well.
Solution 2
you should check SFTP. Filezilla is able to handle SFTP session. also putty provide a pscp command.
Related videos on Youtube
nc4pk
I am a sophomore studying Computer Engineering at North Carolina State University in Raleigh, North Carolina.
Updated on September 17, 2022Comments
-
nc4pk over 1 year
I have connected to a Unix server using SSH from my terminal from my Windows client.
How do I copy files from the Unix server to the Windows client? Can I use the scp and rcp commands? Or are there other ways to do so?
-
Admin over 14 yearsI think it belongs to superuser.com
-
Dan McGrath over 14 yearscongrats on the baby windows client!
-
Admin over 14 years@Dan: ?????? I didn't got it.
-
Admin over 14 years"But i am having a windows client" as in "But i am having a baby". Crikey, humor shouldn't need to be explained :-)
-
Admin over 14 years@pax & dan: sorry arf that's a good joke! but I am not native English speaker so kind of difficult to get that kind of joke!
-
Admin over 14 yearssnif I didn't got any drop of reputation on that ^^ pax you rule them all...
-
RikuXan over 14 yearsI've never seen a joke work on any stack* site, darn it. I've tried.
-
Almir Sarajčić over 14 yearsBut we can still keep trying, can't we?
-
quack quixote over 14 yearskeep trying, @pavium... just use protection or you may end up with a windows client...
-
Shekhar over 10 yearspossible duplicate of Copying files with SSH
-
-
K. King over 14 years@techzen: did you read his question ? last time I checked there was no scp command on the windows distro ...
-
Kalyan02 over 14 yearsi accept your answer, can u please write the syntax for it. Say i have a file xyz.txt in my unix server under abc folder.I want to copy it to my windows desktop.
-
Kalyan02 over 14 years@biranchi: you do the reverse from your windows machice get/put whatever file. It won't be possible to copy from your unix box, since your windows box doesn't have a ssh server.
-
Kalyan02 over 14 years@Biranchi, see the update for a sample command on the Windows side. @RageZ, if you install Cygwin, there's an ssh deomon that you can run but I'd still suggest just using the client on Windows and server on UNIX.
-
Kalyan02 over 14 years@pax; you are right you can run sshd on windows but more easy to use the unix server since it's already there ^^
-
Kalyan02 over 14 years@RageZ: I am using putty to ssh to my unix server.
-
Joey over 14 yearsEek! And s?he's writing to the root of the C: drive. Where you shouldn't even have write permissions, usually. That'd be, like, telling UNIX users to download files somewhere to /