The UNIX and Linux Forums  

Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Copying a list of files from one 'server' to another? Sepia UNIX for Dummies Questions & Answers 6 05-05-2009 09:15 AM
copying .profile files to a new server (SCO) sighbrrguy UNIX for Dummies Questions & Answers 2 12-05-2007 03:02 PM
Copying files from laptop to remote server using SSH patwa UNIX for Dummies Questions & Answers 3 11-22-2006 04:14 AM
copying files to a remote aix server using tar! system-admin AIX 2 11-17-2006 03:30 PM
Copying files between 2 Unix server Docboyeee UNIX for Advanced & Expert Users 9 10-20-2003 02:54 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-17-2008
manoj.solaris manoj.solaris is offline
Registered User
  
 

Join Date: May 2007
Posts: 93
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 (permalink)  
Old 10-17-2008
DukeNuke2's Avatar
DukeNuke2 DukeNuke2 is offline Forum Staff  
Soulman
  
 

Join Date: Jul 2006
Location: Germany, Berlin
Posts: 2,974
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 (permalink)  
Old 10-17-2008
manoj.solaris manoj.solaris is offline
Registered User
  
 

Join Date: May 2007
Posts: 93
Question

Quote:
Originally Posted by DukeNuke2 View Post
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 (permalink)  
Old 10-19-2008
dennis.jacob dennis.jacob is offline Forum Advisor  
dj - the student
  
 

Join Date: Feb 2007
Location: Singapore/Bangalore/Cochin
Posts: 592
Quote:
Originally Posted by DukeNuke2 View Post
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
  #5 (permalink)  
Old 10-19-2008
ikorolev ikorolev is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 40
Quote:
Originally Posted by manoj.solaris View Post
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
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:29 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0