Copying files from a remote server to local system with cygwin


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Copying files from a remote server to local system with cygwin
# 1  
Old 02-07-2007
Copying files from a remote server to local system with cygwin

Hi. I'm sorry if I get on people's nerves asking this, but I don't really understand how to do this and unfortunately don't have the time to work through it step by step in books, etc.

At University, we have a unix server that hosts our files. we each have a login and password to access it. I would like to copy the files in my home directories there to my laptop. due to security, the only way I'm even able to access the files let alone do anything with them is to ssh in through cygwin which I've installed.

I do:
ssh -l username host
password

Then I can cd to the directories. But here's where I'm stuck.

I'm not sure of the format to copy a file to my home directory on my cygwin, because home when I'm logged into the server is the home directory on the server. But if I open another cygwin window, I can't seem to access the Uni files in the other window.

My laptop has an IP address from the wireless network I'm connect to.

Can anyone help me with this please? I'm sure it simple, basically copying from HOME where I'm logged in to HOME on my laptop but how do I specify the laptop? Is it just the IP/home as in 139.133.123.456/home?

sorry if this is too vague, they're not prepared to take people through the basics of Unix, well transferring between computers like this anyway as I'm the only one that needs to do it due to not being able to access the Unix systems directly (partially sighted).

Thanks.
# 2  
Old 02-16-2007
I think you should use sftp to transfer the files from your university account to your laptop.

The thing is quite easy: first, working in your laptop's cygwin, go into the directory where yo want the files to get transfered.
Then, connect to your university using sftp program, sftp username@host and then enter your pasword. Once you are in, cd to the directory where your files are. You can now use the comand "get" to transfer the files to your laptop: get file1, get foo.txt, etc.

I hope this helps you (I've read your message quickly)
# 3  
Old 02-21-2007
Thanks. I eventually just used a windows client, as i couldn't get the get command to work for a whole directory. How can I do it the other way around?

I have one terminal logged into my website with ssh. I'm in the directory i want to upload to.

I have another terminal where i'm in the directory which comtains files and folders i want to transfer. how do I copy those files and folders to the directory in the first terminal?

Thanks.

H.
# 4  
Old 06-12-2008
USE scp to transfer your files:

on your cygwin command prompt type command like this;

scp -r <user_name>@<host_name or host_ip>:<Path to your directory> <target_path_dir>

For eg.
Source dir= /home/patwa/mywork
Host= UnixServer
User Name= patwa
Target dir=/cygdrive/d/patwa

then command will look like this:
scp -r patwa@UnixServer:/home/patwa/mywork /cygdrive/d/patwa

if above command gives error for "/cygdrive/d/patwa"
than
cd /cygdrive/d/patwa

scp -r patwa@UnixServer:/home/patwa/mywork .
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Copying files to remote server

I am trying to copy code to remote server, doing something like this However it is copying one file and than the script exits i=0; j=0 while read fn; do dir=${fn%/*} # Gets directory path fnm=${fn##*/} # Gets filename excl. path rgx_nwk="s/${nwk}/${nwk}.sac/g" ... (2 Replies)
Discussion started by: kristinu
2 Replies

2. Solaris

Script to get files from remote server to local server through sftp without prompting for password

Hi, I am trying to automate the process of fetching files from remote server to local server through sftp. I have the username and password for the remote solaris server. But I need to give password manually everytime i run the script. Can anyone help me in automating the script such that it... (3 Replies)
Discussion started by: ssk250
3 Replies

3. UNIX for Dummies Questions & Answers

How to copy files from remote server to local?

Hi experts, I 'm newbie to unix world, now I have task to copy the latest files from remote server to my local. I believe this must be very common request in this community. I want you do it one more time for me please. My requirement is something like this: I receive files in the below... (3 Replies)
Discussion started by: parpaa
3 Replies

4. UNIX for Dummies Questions & Answers

compare zip files from a local to remote server

Good evening I need your help pease I know there are 2 commands(diff, or cp) to compare files in a directory. but the question arises: 1. can i compare zip files or ive got to unzip them? 2. how can i compare 2 files from a local to a remote server? (is there any special commad or ive got... (4 Replies)
Discussion started by: alexcol
4 Replies

5. UNIX for Dummies Questions & Answers

Copying files from Unix Server to Local

How to copy files from Unix server to Local (6 Replies)
Discussion started by: win4luv
6 Replies

6. UNIX for Dummies Questions & Answers

Copying files from Unix Server to Local

How do i copy files from Unix Server to my Local Desktop.. ANy ideas..please suggest....V Urgent. (1 Reply)
Discussion started by: win4luv
1 Replies

7. UNIX for Dummies Questions & Answers

Automatically copying files from server to local drive?

I would like automate the process of copying some logs files from a server to my local hard drive at a set time each week/day. I don't really know anything about creating and scheduling jobs. Is this something I could setup relatively easily? I would like to automatically copy all the logs... (1 Reply)
Discussion started by: Sepia
1 Replies

8. Shell Programming and Scripting

FTP multiple files from remote server to local server

Hi, I am facing a weired problem in my FTP script. I want to transfer multiple files from remote server to local server everyday, using mget * in my script. I also, want to send an email for successful or failed FTP. My script works for file transfer, but it don't send any mail. There is... (2 Replies)
Discussion started by: berlin_germany
2 Replies

9. UNIX for Dummies Questions & Answers

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... (3 Replies)
Discussion started by: patwa
3 Replies

10. AIX

copying files to a remote aix server using tar!

Hi, I am using AIX 5.2, and I want to copy some files from one server to a remote server using tar command. Can anybody tell me exact command? Thanks. Aqeel (2 Replies)
Discussion started by: system-admin
2 Replies
Login or Register to Ask a Question