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

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.

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
----------------------------------