Link to home
Start Free TrialLog in
Avatar of parlays
parlays

asked on

Using SSH can I quickly copy between my local HD and the remote server?

Hello everybody!

I am running Ubuntu, and using my terminal to ssh into a remote server.  What is the best way to transfer files between the remote server and my local hard drive.

I tried using 'scp' and it only seemed to work if I am running it on my local computer and not while I am SSHing.  Any ideas or recommendations?
Avatar of Tintin
Tintin

Are you saying that if you ssh to the remote server, and then do a scp to/from the remote server it doesn't transfer the files?

Do you get any error messages?
SOLUTION
Avatar of martin_2110
martin_2110
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
the above command should be run on your local desktops terminal.
Avatar of parlays

ASKER

What i would like to do is to SSH into the remote server.  From there I would like to type a command to copy files from my local hard drive?  When I try using SCP, I have no idea what to type as the source because my local hard drive doesn't have a domain name.  You know what I mean.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of parlays

ASKER

How do I do it the other way around?  Once I am SSHed into the remote server how do I copy from my local hd?
If you are on the remote server, you do

scp user@you-local-server:/path/to/files* /some/path

Avatar of parlays

ASKER

'your-local-server' ?

That's what I need to figure out.

What is my local server?  'localhost'?  i'll try that, but isn't there a way to specify to grab from my local drive other than using a server name?
Use the IP.  'localhost' is always the local system, in context.  That means if you SSH into the remote server, 'localhost' means the remote server's local system.
Avatar of parlays

ASKER

Gotcha, i'll get my IP address of the router, checking what it is with 'ifconfig'.  Is that correct?

I'll test it out tomorrow, thanks for your help.
You don't want the IP address of your router, unless your local server also acts as the router.

If you are behind a firewall and/or have a NATed address, then you are going to run into difficulties.
Avatar of parlays

ASKER

Well picture my setup.  I'm on a laptop running Ubuntu connected to the internet through a router.

I connect to a remote server using the terminal, and now using SSH on the remote server I want to copy a file from my local hard drive on the laptop.

The laptop i'm using I don't think has an IP address?  Can I connect to it?  Or is the only way to use 'scp' from the local hard drive to the remote server?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of parlays

ASKER

Cool, I hear ya.  I'm just trying to see what is possible and learn the best way to copy files.  Still new to using these tools.

I have no prob copying from the local to the remote server.  Thanks for all the help and responses fellas.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Any progress on this side? Did you test the tunnel solution?