Link to home
Start Free TrialLog in
Avatar of wilsj
wilsj

asked on

scp without password

scp question.

I have a fedora core 3 pc and a CentOS 5 pc. I want to be able to scp a file from the FC3 pc to the CentOS 5 pc. I have tried generating rsa keys on the FC3 pc and scp the *.pub file to the CentOS5 pc and copied the info to a authorized_keys file. But when I log into the CentOS 5 I still get promted for the password. I've also tried renaming the authorized_keys to authorized_keys2 and chmod 777 to the key file but still get prompted. I also have restarted the sshd service. Any help is appreciated.
Avatar of alextoft
alextoft
Flag of United Kingdom of Great Britain and Northern Ireland image

Have you tried ssh -v user@host to get the verbose info which might point to the problem?
Avatar of wilsj
wilsj

ASKER

This is what I get. When I generated the keys and it asked to specify a password I just hit enter. That should leave it blank correct?

debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to summit-u01 [192.168.7.226] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/identity type -1
debug1: identity file /root/.ssh/id_rsa type 1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3
debug1: match: OpenSSH_4.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.9p1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'summit-u01' is known and matches the RSA host key.
debug1: Found key in /root/.ssh/known_hosts:2
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: gssapi-with-mic
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/identity
debug1: Offering public key: /root/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Next authentication method: password
Hm, try on the server side account
chmod 0700 .ssh
chmod 0644 .ssh/authorized_keys
Helped?
Avatar of wilsj

ASKER

I Still get the same thing. if it helps at all this is the command I issued ssh-keygen -t rsa. And the versions of ssh

OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003 FC3pc

OpenSSH_4.3p2, OpenSSL 0.9.8b 04 May 2006 CentOS5 pc
Can You do that on the server side?
/etc/init.d/sshd stop
sshd -d # will log debug messages to stdout, maybe You'll find something
then try connecting from client.
After that start the sshd in normal mode again
/etc/init.d/sshd start
Try the following:
1. dsa keys
2. On the client - Make sure .ssh directory has permissions 700 and your .ssh/id_rsa file has permissions 600.
Avatar of Arty K
In that case better to debug both server and client side. So follow ravenpl's comment to start server in debug mode and follow alextoft's comment to connect from client in debug mode.
Also ensure, that you have enabled rsa authentication on server 'RSAAuthentication yes'.

Server log in that case should be more helpfull. But be aware that after client's disconnect your sshd with '-d' will die and you may loose connectivity.
> debug1: Next authentication method: publickey
> debug1: Trying private key: /root/.ssh/identity
> debug1: Offering public key: /root/.ssh/id_rsa
Looks like client is trying, that's why I suggested server debug now.
Avatar of wilsj

ASKER

should i be generating the keys from the fc3 box or the centos5? I want to connect to the centos5 from fc3.
ASKER CERTIFIED SOLUTION
Avatar of ravenpl
ravenpl
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of wilsj

ASKER

This is what i get when i do sshd -d

sshd re-exec requires execution with an absolute path
run it with absolute path:
`which sshd` -d