copying files from one server to another server


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting copying files from one server to another server
# 1  
Old 10-17-2008
Question copying files from one server to another server

Hi,

I want to transfer files from one linux server to another linux server using shell script using sftp.

But I dont won't that while connecting one server to another server it will ask for password , it should be part of script.

I wont to know how password should be included in the script.

so after execution of script files should be copied without asking password from one server to another server.

Regards,

Manoj
# 2  
Old 10-17-2008
maybe "expect" is your friend. but the password will be inside the script... this is a security problem. so maybe a nfs share is a better solution?
# 3  
Old 10-17-2008
Question

Quote:
Originally Posted by DukeNuke2
maybe "expect" is your friend. but the password will be inside the script... this is a security problem. so maybe a nfs share is a better solution?
Hi DukeNuke2,

Thanks for quick response, but in our environment nfs is not allowed.
# 4  
Old 10-19-2008
Quote:
Originally Posted by manoj.solaris
Hi,

I want to transfer files from one linux server to another linux server using shell script using sftp.

so after execution of script files should be copied without asking password from one server to another server.


Manoj
sftp use ssh protocol for copyng, you can generate keys and put it on destination server.
man ssh-keygen
# 5  
Old 10-19-2008
Quote:
Originally Posted by DukeNuke2
maybe "expect" is your friend. but the password will be inside the script... this is a security problem. so maybe a nfs share is a better solution?

Use expect only if you have no ssh.

Or, install the ssh(may be OpenSSH) which will help you to transfer files without prompting passwords..

What you needs to do is

1.Install SSH
2.create the keys using rsa or dsa
eg. sshkeygen -t rsa
3.Copy the public key and add it to the authorized key file in the .ssh directory of the destination server
4. Do scp or sftp with file
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. Shell Programming and Scripting

How to preserve time stamp while copying a directory from Server B to Server A?

Experts, Please help me out here. How to preserve time stamp while copying a directory from Server B to Server A (3 Replies)
Discussion started by: ahmed.vaghar
3 Replies

3. Shell Programming and Scripting

Copying the files to Windows server from UNIX server

Hi Team, I had a requirement to write a shell script which automatically transfer the files from unix server to windows server. I can able to unix to unix using Scp command. I am not sure how to do unix to windows. I am very new on this concept. Could you please help me or guide in... (4 Replies)
Discussion started by: gvkumar25
4 Replies

4. Shell Programming and Scripting

Copying files from one server to another server?

Hi all, In Server1, one directory contains files now. In this directory, based on some operations, daily some files will generate and store regularly. Now i want to copy the files to Server2 through SFTP/FTP command on daily based on the previous day present data(i.e based on the latest file... (1 Reply)
Discussion started by: venkat6134
1 Replies

5. UNIX for Dummies Questions & Answers

Copying files from one server to another

I need to copy huge set of data(files & floder) from one server to other. Can any one guide me.I have tried throught ftp mget but it is vain...floder are not moving...... Do suggest me any good method (12 Replies)
Discussion started by: kkalyan
12 Replies

6. UNIX for Dummies Questions & Answers

Copying files from different server

Is there any option to copy files from a different server other than using an SCP command??? thanks,:b: Arun manas (2 Replies)
Discussion started by: arunmanas
2 Replies

7. Shell Programming and Scripting

Copying files from one server to other.

Any one advice here- need to copy some files from one server to other server thru shell programming. (8 Replies)
Discussion started by: samkhu
8 Replies

8. Shell Programming and Scripting

Shell script for copying files from 1 server to other

Hi, I just need a shell script that copies a list of files from a directory in a remote server to my current directory at local server the remote server may contain the following list: /root/pradeep/myfiles/default /root/pradeep/myfiles/dir1 /root/pradeep/myfiles/dir2 ...... (1 Reply)
Discussion started by: paddu
1 Replies

9. UNIX for Dummies Questions & Answers

Copying a list of files from one 'server' to another?

I have two servers. I would like to copy some files from one directory on server A into the same directory on server B. Its not all the files in in the directory, just some of them. Is there a way to make a file list in a txt file and then somehow copy all the files in that list in one go to... (6 Replies)
Discussion started by: Sepia
6 Replies

10. UNIX for Advanced & Expert Users

Copying files between 2 Unix server

Is there a simple way to copy data from one server to a different server? Seems that if 2 servers are on the same network, there should be a simple way to copy between the two. Not just one file. I need to copy a whole directory with subdirectories from one server to a different one. I... (9 Replies)
Discussion started by: Docboyeee
9 Replies
Login or Register to Ask a Question