PDA

View Full Version : SCP command help


Desmo
11-11-2008, 15:03
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.

Daz
11-11-2008, 15:08
From the desktop, something like:
scp user@server:/path/to/file /home/user/desktop

:)

Desmo
11-11-2008, 15:17
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?

Daz
11-11-2008, 15:29
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 :)

Desmo
11-11-2008, 15:38
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 :)

Mark
11-11-2008, 21:04
sftp might be helpful for you here. It's a bit like ftp (so you get a prompt), but it's secure.

Burble
11-11-2008, 21:10
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.

Mark
11-11-2008, 21:29
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.

Desmo
11-11-2008, 21:38
Want to copy from my webspace to my Desktop.

Mark has got it :)

Daz
11-11-2008, 21:38
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 :)

Mark
11-11-2008, 21:49
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').

Desmo
11-11-2008, 22:45
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 :)