View Full Version : SCP command help
Had a look around the net but can't find an answer.
When using SCP to copy files from server to server or desktop to server I can get it working. But what if I'm on the server and just want to copy a file to the desktop. I can't seem to get the command right.
From the desktop, something like:
scp user@server:/path/to/file /home/user/desktop
:)
I can do it fine from the desktop. But lets say I've SSH'd into my server, found the file I want and just want to copy it to the desktop.
I want to go "scp file.abc Desktop" somehow. I'm not sure it's possible is it?
You would need an ssh server running on the Desktop, reachable from the server. I dont know of any trick to just bring it back to an client connected as a tty. You'd need a client that somehow realised it was receiving binary data from stdout which then pumps that into another file, which would be messy to detect and handle I guess.
Not something I've ever had to use though so there might be a more obvious it can happen :)
It's not a problem and I'm probably trying to do something that's not meant to happen, just for ease.
I guess it was just so I didn't have to remember the full path to the file on the server. I could just navigate there and then SCP the file to the desktop. Nae bother :)
sftp might be helpful for you here. It's a bit like ftp (so you get a prompt), but it's secure.
I want to go "scp file.abc Desktop" somehow. I'm not sure it's possible is it?
Just so I'm understanding what you're trying to do, are you trying to copy a file from someone on a machine to somewhere else on the same machine or are you trying to copy from one machine to another?
I'm pretty sure you mean the latter but wanted to be sure.
I think the gist is this - start with a desktop machine, ssh into a server, and then copy a file back to the desktop machine.
Want to copy from my webspace to my Desktop.
Mark has got it :)
Yeah, I think Des wants to pull it back in the client. Use putty to get into something, find a file you want, and just bring it back through the client somehow is how I read it :)
Which, as I said earlier, is what I use sftp (or, in the Putty case, psftp) for. Obviously, the 'finding a file' options are rather limited (to pretty much what you can do with 'ls').
Like I said, it's no biggy and doesn't really need a solution. It's just something I thought I could do and was getting wrong :)
vBulletin® v3.7.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.