The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Script required to get a required info from file. Pls. help me. ntgobinath Shell Programming and Scripting 2 05-31-2008 05:34 AM
SFTP & Passphrase('s) Cameron Shell Programming and Scripting 4 05-27-2008 05:51 AM
creating passphrase file ansori SUN Solaris 6 09-30-2007 04:12 AM
SSH passphrase and Password jOOc SUN Solaris 3 05-16-2007 10:29 AM
passphrase and ssh authentication Minguccio75 UNIX for Advanced & Expert Users 1 01-19-2007 04:27 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 09-26-2002
Registered User
 

Join Date: Feb 2002
Location: Germany - Heilbronn
Posts: 4
Unhappy ssh - at login Passphrase for key required

Hello,

I want to use a shell-script to transfer data over sftp.
I donīt find a way to login in automatically.
I tried to send the password in a script like possible with
ftp

sftp user@server << cmd
password
cd /distant/directory
lcd /local/directoryget ssh_install
get ( or put) your files
quit
cmd

It doesnīt work. So I tried to use a public key (Public key authentication). But now I always have to write the
passphrase - same problem again.

How is it possible to connect withput password or phrase?

Thanks!
Oliver
Forum Sponsor
  #2  
Old 09-26-2002
Registered User
 

Join Date: Sep 2002
Location: UK
Posts: 65
man ssh-keygen or man ssh-keygen2 - depending upon what version of Secure Shell you are using. The ssh-keygen command generates public and private keys for a user. There is a switch on this command (usually -P) which allows for a null passphrase.

Alternatively run ssh-keygen as that user and when you are prompted to enter a passphrase simply enter a carriage return. The keys will be stored with a null passphrase.

If you exchanged the public key correctly you should now be able to copy files without being prompted for a passphrase.
__________________
Free Palestine
  #3  
Old 09-26-2002
HappyByte
Guest
 

Posts: n/a
below is my conspect of using scp
may be auth method will help for sftp also

user mailreplicator must exist on all machines
user mailreplicator mush have valid shell (bash or so)

now you can access or use scp to any of hosts w/o pass

/usr/bin/scp -pBqC -P 2200 mailreplicator@rc.host.com:/var/qmail/control/virtualdomains .

----------------------------------
su - mailreplicator

#1) generate rsa & dsa keys
ssh-keygen -t rsa
ssh-keygen -t dsa

#2) prepare remote authorized_keys2
cat .ssh/id_rsa.pub .ssh/id_dsa.pub > .ssh/authorized_keys2
mkdir .ssh/.ssh
cp .ssh/authorized_keys2 .ssh/.ssh

#3) fix permissions
/usr/bin/find .ssh -type d -exec /bin/chmod 700 \{} \;
/usr/bin/find .ssh -type f -exec /bin/chmod 600 \{} \;

#4) propagate keys on all hosts !!! PASSWORDS are now required
scp -pvqC -P 2200 -c 3des -r .ssh/.ssh mailreplicator@rc.host.com:/usr/home/mailreplicator/.ssh
scp -pvqC -P 2200 -c 3des -r .ssh/.ssh mailreplicator@bb.host.com:/usr/home/mailreplicator/.ssh
scp -pvqC -P 2200 -c 3des -r .ssh/.ssh mailreplicator@ob.host.com:/usr/home/mailreplicator/.ssh
scp -pvqC -P 2200 -c 3des -r .ssh/.ssh mailreplicator@m1.host.com:/usr/home/mailreplicator/.ssh
scp -pvqC -P 2200 -c 3des -r .ssh/.ssh mailreplicator@h1.host.com:/usr/home/mailreplicator/.ssh
scp -pvqC -P 2200 -c 3des -r .ssh/.ssh mailreplicator@ac.host.com:/usr/home/mailreplicator/.ssh
scp -pvqC -P 2200 -c 3des -r .ssh/.ssh mailreplicator@sm.host.com:/usr/home/mailreplicator/.ssh
scp -pvqC -P 2200 -c 3des -r .ssh/.ssh mailreplicator@host.com:/usr/home/mailreplicator/.ssh
----------------------------------
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 03:45 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0