Copying files from laptop to remote server using SSH | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Copying files from laptop to remote server using SSH

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 11-21-2006
patwa patwa is offline
Registered User
 
Join Date: Nov 2006
Last Activity: 25 June 2007, 12:50 PM EDT
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Copying files from laptop to remote server using SSH

Hello,

I'm sorry if this sounds like a very simple question, but I'm having some difficulty with it being a complete newbie to UNIx. I use Windows, and always have, but need some UNIX access for work, picking up files from our group space, etc.

Basically, I'm using Cygwin and can SSH into the server using my username and password, and can see the files on there. what I'm not sure of is how to copy files from outside the server, i.e from my laptop.

On windows you would simply do something like copy:
12.34.56.78/C/Docs/myfile.txt to 87.65.43.21/myfile.txt.

But with UNIx, and by proxy cygwin, using the whole idea of a home directory, I'm really not sure how the command would be written, or how the directories would work. Also, how do I write a location that is outside the server when in the server directory structure?

I hope this makes sense, and any help is appreciated.

Thanks.

Hussein.
Sponsored Links
    #2  
Old 11-21-2006
grial's Avatar
grial grial is offline Forum Advisor  
El UNIX es como un toro
 
Join Date: Jun 2006
Last Activity: 1 December 2008, 8:39 AM EST
Location: Madrid (Spain)
Posts: 531
Thanks: 0
Thanked 1 Time in 1 Post
Helo.
This is the scenario: You are working on yout laptop which runs Windows with cygwin. Then, from your cygwin bash shell:
- Transfer file from your laptop to the UNIX server:
Have a look at this thread: copying files to a remote aix server using tar!
- Tansfer files from the UNIX server to your laptop:
ssh user@unix_server tar cvf - /whatever | tar xvf -
have a look to ssh/tar manpages for more options.

Alternatively you could use either "sftp" or "scp" commands.

Regards.
Sponsored Links
    #3  
Old 11-21-2006
patwa patwa is offline
Registered User
 
Join Date: Nov 2006
Last Activity: 25 June 2007, 12:50 PM EDT
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Hi thanks for the link and I do appreciate it.

Part of the problem is that I don't seem to have the man feature on my cygwin setup - when I type command man I just get an error saying it couldn't be found.

Anyway, for the file transfer, I'm still confused. I'm thinking I need to wrap the files into an archive first, right? And then transfer?

but I'm not sure about the actual command syntax to do the transfer. From my laptop to the server would be easy, as I'm already in the directory I want to transfer from, but...

when I log into the server, and then do a pwd, I get /home/student/cs/username/ and this is my home directory.

I have a username and password to log into my part of the server. that logs me into the directory referenced above.

I usually ssh with ssh -l username server.csd.uni.ac.uk and then it asks me for the password.

So would I be transferring to the full path on the server, presumably server.csd.uni.ac.uk/home/student/cs/username, or would I be going to just the server, and then somehow using the login to map to the directory?

When transferring to the laptop, would I use the IP address as the pointer to the laptop, and then what path do I use to the home directory for cygwin? I'm guessing it wouldn't be C:\cygwin\home\H as this is Windows speak.

sorry, but as I said, total newbie to this and I've pretty much only got to gripswith the bear minimum I need to function, which is handling files on the server itself, but now I want to be able to take work home with me and upload it back when I've worked on it.

Thanks for your patience and for bearing with me.

Hussein.
    #4  
Old 11-22-2006
grial's Avatar
grial grial is offline Forum Advisor  
El UNIX es como un toro
 
Join Date: Jun 2006
Last Activity: 1 December 2008, 8:39 AM EST
Location: Madrid (Spain)
Posts: 531
Thanks: 0
Thanked 1 Time in 1 Post
Quote:
Originally Posted by patwa
Hi thanks for the link and I do appreciate it.

Part of the problem is that I don't seem to have the man feature on my cygwin setup - when I type command man I just get an error saying it couldn't be found.
You should install and use it. Though, perhaps you only have to configure the MANPATH variable...

Quote:
Originally Posted by patwa
Anyway, for the file transfer, I'm still confused. I'm thinking I need to wrap the files into an archive first, right? And then transfer?
No, you don't need to do that. That's just a way to transfer a bunch of files...
Quote:
Originally Posted by patwa
So would I be transferring to the full path on the server, presumably server.csd.uni.ac.uk/home/student/cs/username, or would I be going to just the server, and then somehow using the login to map to the directory?
As you are using ssh, you will (by default) be tranferring to your home directory, though you can change to wherever you want/can.
Quote:
Originally Posted by patwa
When transferring to the laptop, would I use the IP address as the pointer to the laptop, and then what path do I use to the home directory for cygwin? I'm guessing it wouldn't be C:\cygwin\home\H as this is Windows speak.
Cygwin is, basically, a UNIX environment fot windows. You should use UNIX paths as if you were logged on a UNIX server. But Cygwin is not an emulator, so you will be using your real NTFS File System. In my case, my home directory from the point of view of cygwin is "/cygdrive/c/Documents and Settings/grial", but for windows, it's "C:\Documents and Settings\grial"
Quote:
Originally Posted by patwa
sorry, but as I said, total newbie to this and I've pretty much only got to gripswith the bear minimum I need to function, which is handling files on the server itself, but now I want to be able to take work home with me and upload it back when I've worked on it.

Thanks for your patience and for bearing with me.

Hussein.
Finally, to understand those commands, you will need to understand the use of pipes. Just as an introdunction, if yoy have this command:

command1 | command2

Then, command1 oputput will be redirected to command2 input.

Regards.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Copying files to a remote NFS filesystem iga3725 UNIX for Dummies Questions & Answers 4 06-09-2011 11:24 AM
Copying files from different server arunmanas UNIX for Dummies Questions & Answers 2 02-08-2011 01:44 AM
copying files from remote computer krabu Shell Programming and Scripting 2 09-06-2008 04:24 AM
Copying files from a remote server to local system with cygwin patwa UNIX for Dummies Questions & Answers 3 06-12-2008 07:49 AM
copying files to a remote aix server using tar! system-admin AIX 2 11-17-2006 02:30 PM



All times are GMT -4. The time now is 06:43 AM.