1834022 Members
2241 Online
110063 Solutions
New Discussion

scp without password

 
Josee Pouliot_1
Occasional Advisor

scp without password

Does anyone know how to use scp without getting ask for a password?
Thank you.
7 REPLIES 7
Sanjay_6
Honored Contributor

Re: scp without password

Hi Josee,

Try this link on setting up ssh/scp between server without password.

http://bumblebee.lcs.mit.edu/ssh2/

make sure you are using the correct steps for proper version of ssh/sshd.

Hope this helps.

Regds
Slawomir Gora
Honored Contributor

Re: scp without password

Hi,

it can halp yoy - the same method is for scp as for ssh.

http://www.cs.umd.edu/~arun/misc/ssh.html
Florian Heigl (new acc)
Honored Contributor

Re: scp without password

Hi,

You should generate a public key on the source host
cd /your/home/dir
ssh-keygen -t dsa 1024
(don't enter a passphrase)

on the target host go to the copying users' home directory, create a directory .ssh with mode 700 there.
then copy the sourcehost:/home/you/.ssh/id_dsa.pub targethost:/home/you/.ssh/authorized_keys and chmod' it to 600.

afterwards this should work out of the box, or sshd will output it's errors to /var/adm/syslog/syslog.log

good luck :)
yesterday I stood at the edge. Today I'm one step ahead.
Marco Santerre
Honored Contributor

Re: scp without password

Thanks to all we've been able to figure out how to make it work, but I'd like to add one more issue with this :

How can you scp using those public keys with root when sshd_config is configured with "PermitRootLogin no"?

Thanks

Cooperation is doing with a smile what you have to do anyhow.
Elmar P. Kolkman
Honored Contributor

Re: scp without password

What do you think yourself?
scp uses ssh to login and then starts a local command to start copying the files through the ssh tunnel. So there is no way to build the tunnel as root if the permitrootlogin is false.
Unless this is not the case on both systems...
Every problem has at least one solution. Only some solutions are harder to find.
Steven E. Protter
Exalted Contributor

Re: scp without password

The official guide(attached).

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Dave Evenson
New Member

Re: scp without password

You will need to set up your ssh account with SSH agent forwarding activated. Create account keys with ssh-keygen. Use ssh-agent & ssh-add to set up agent forwarding. You'll be asked for the account password / passphrase once. The agent will securely cache passphrase for the lifetime of your current session.
/usr/local/bin/ssh-agent $SHELL
/usr/local/bin/ssh-add
prompt for passphrase >