linux - Passwordless SSH works only in debug mode -


i have 2 machines, identical users, need passwordless ssh between them, have 2 users medya , orainst

medya home /home/medya/ orainst home /tools/appsw/oracle/orainst

i have set passwordless both of them ( yes swear did permissions, religiously ).

it works user in normal home directories (medya) not orainst.

and weirdest thing is, if run ssh server in debug mode, works both of users fine !!!

here log both ssh starting service , ssh starting debug

here fails :

debug1: trying public key file /tools/appsw/oracle/orainst/.ssh/authorized_keys debug1: not open authorized keys '/tools/appsw/oracle/orainst/.ssh/authorized_keys': permission denied debug1: restore_uid: 0/0 debug1: temporarily_use_uid: 500/500 (e=0/0) debug1: trying public key file /tools/appsw/oracle/orainst/.ssh/authorized_keys 

here full log:

[root@ip-10-16-4-114 oracle]# service sshd start  starting sshd: debug1: sshd version openssh_5.3p1 debug1: read pem private key done: type rsa debug1: private host key: #0 type 1 rsa debug1: read pem private key done: type dsa debug1: private host key: #1 type 2 dsa debug1: rexec_argv[0]='/usr/sbin/sshd' debug1: rexec_argv[1]='-d' set /proc/self/oom_score_adj 0 -1000 debug1: bind port 22 on 0.0.0.0. server listening on 0.0.0.0 port 22. debug1: bind port 22 on ::. server listening on :: port 22. debug1: server not fork when running in debugging mode. debug1: rexec start in 5 out 5 newsock 5 pipe -1 sock 8 debug1: inetd sockets after dupping: 3, 3 connection 10.16.4.113 port 56175 debug1: client protocol version 2.0; client software version openssh_5.3 debug1: match: openssh_5.3 pat openssh* debug1: enabling compatibility mode protocol 2.0 debug1: local version string ssh-2.0-openssh_5.3 debug1: permanently_set_uid: 74/74 debug1: list_hostkey_types: ssh-rsa,ssh-dss debug1: ssh2_msg_kexinit sent debug1: ssh2_msg_kexinit received debug1: kex: client->server aes128-ctr hmac-md5 none debug1: kex: server->client aes128-ctr hmac-md5 none debug1: ssh2_msg_kex_dh_gex_request received debug1: ssh2_msg_kex_dh_gex_group sent debug1: expecting ssh2_msg_kex_dh_gex_init debug1: ssh2_msg_kex_dh_gex_reply sent debug1: ssh2_msg_newkeys sent debug1: expecting ssh2_msg_newkeys debug1: ssh2_msg_newkeys received debug1: kex done debug1: userauth-request user orainst service ssh-connection method none debug1: attempt 0 failures 0 debug1: pam: initializing "orainst" debug1: pam: setting pam_rhost "10.16.4.113" debug1: pam: setting pam_tty "ssh" debug1: userauth-request user orainst service ssh-connection method publickey debug1: attempt 1 failures 0 debug1: temporarily_use_uid: 500/500 (e=0/0) **debug1: trying public key file /tools/appsw/oracle/orainst/.ssh/authorized_keys debug1: not open authorized keys '/tools/appsw/oracle/orainst/.ssh/authorized_keys': permission denied debug1: restore_uid: 0/0 debug1: temporarily_use_uid: 500/500 (e=0/0) debug1: trying public key file /tools/appsw/oracle/orainst/.ssh/authorized_keys** debug1: not open authorized keys '/tools/appsw/oracle/orainst/.ssh/authorized_keys': permission denied debug1: restore_uid: 0/0 failed publickey orainst 10.16.4.113 port 56175 ssh2 connection closed 10.16.4.113 debug1: do_cleanup debug1: do_cleanup debug1: pam: cleanup 

and log running ssh server in debug mode (when this, both users can passwordless ssh)

[root@ip-10-16-4-114 oracle]# /usr/sbin/sshd -d -p 2222 debug1: sshd version openssh_5.3p1 debug1: read pem private key done: type rsa debug1: private host key: #0 type 1 rsa debug1: read pem private key done: type dsa debug1: private host key: #1 type 2 dsa debug1: rexec_argv[0]='/usr/sbin/sshd' debug1: rexec_argv[1]='-d' debug1: rexec_argv[2]='-p' debug1: rexec_argv[3]='2222' set /proc/self/oom_score_adj 0 -1000 debug1: bind port 2222 on 0.0.0.0. server listening on 0.0.0.0 port 2222. debug1: bind port 2222 on ::. server listening on :: port 2222. debug1: server not fork when running in debugging mode. debug1: rexec start in 5 out 5 newsock 5 pipe -1 sock 8 debug1: inetd sockets after dupping: 3, 3 connection 10.16.4.113 port 47631 debug1: client protocol version 2.0; client software version openssh_5.3 debug1: match: openssh_5.3 pat openssh* debug1: enabling compatibility mode protocol 2.0 debug1: local version string ssh-2.0-openssh_5.3 debug1: permanently_set_uid: 74/74 debug1: list_hostkey_types: ssh-rsa,ssh-dss debug1: ssh2_msg_kexinit sent debug1: ssh2_msg_kexinit received debug1: kex: client->server aes128-ctr hmac-md5 none debug1: kex: server->client aes128-ctr hmac-md5 none debug1: ssh2_msg_kex_dh_gex_request received debug1: ssh2_msg_kex_dh_gex_group sent debug1: expecting ssh2_msg_kex_dh_gex_init debug1: ssh2_msg_kex_dh_gex_reply sent debug1: ssh2_msg_newkeys sent debug1: expecting ssh2_msg_newkeys debug1: ssh2_msg_newkeys received debug1: kex done debug1: userauth-request user orainst service ssh-connection method none debug1: attempt 0 failures 0 debug1: pam: initializing "orainst" debug1: pam: setting pam_rhost "10.16.4.113" debug1: pam: setting pam_tty "ssh" debug1: userauth-request user orainst service ssh-connection method publickey debug1: attempt 1 failures 0 debug1: temporarily_use_uid: 500/500 (e=0/0) debug1: trying public key file /tools/appsw/oracle/orainst/.ssh/authorized_keys debug1: fd 4 clearing o_nonblock debug1: matching key found: file /tools/appsw/oracle/orainst/.ssh/authorized_keys, line 1 found matching rsa key: 6c:ab:f3:3b:68:c3:ed:f1:d6:ae:a5:f8:06:2f:d3:8c debug1: restore_uid: 0/0 debug1: ssh_rsa_verify: signature correct debug1: do_pam_account: called accepted publickey orainst 10.16.4.113 port 47631 ssh2 debug1: monitor_child_preauth: orainst has been authenticated privileged process debug1: temporarily_use_uid: 500/500 (e=0/0) debug1: ssh_gssapi_storecreds: not gssapi mechanism debug1: restore_uid: 0/0 debug1: selinux support enabled debug1: pam: establishing credentials debug1: temporarily_use_uid: 500/500 (e=0/0) debug1: ssh_gssapi_storecreds: not gssapi mechanism debug1: restore_uid: 0/0 user child on pid 6171 debug1: pam: establishing credentials debug1: permanently_set_uid: 500/500 debug1: entering interactive session ssh2. debug1: server_init_dispatch_20 debug1: server_input_channel_open: ctype session rchan 0 win 1048576 max 16384 debug1: input_session_request debug1: channel 0: new [server-session] debug1: session_new: session 0 debug1: session_open: channel 0 debug1: session_open: session 0: link channel 0 debug1: server_input_channel_open: confirm session debug1: server_input_global_request: rtype no-more-sessions@openssh.com want_reply 0 debug1: server_input_channel_req: channel 0 request pty-req reply 1 debug1: session_by_channel: session 0 channel 0 debug1: session_input_channel_req: session 0 req pty-req debug1: allocating pty. debug1: session_new: session 0 debug1: session_pty_req: session 0 alloc /dev/pts/1 debug1: server_input_channel_req: channel 0 request env reply 0 debug1: session_by_channel: session 0 channel 0 debug1: session_input_channel_req: session 0 req env debug1: server_input_channel_req: channel 0 request shell reply 1 debug1: session_by_channel: session 0 channel 0 debug1: session_input_channel_req: session 0 req shell 

i believe true problem existence of symbolic link in path .ssh folder triggers check of permissions. similar how selinux requires authorized_keys file disallow group write access file (have chmod value of 600 essentially), enforces same rule .ssh folder , symbolic links in path authorized_keys file.

the answer here think good: https://unix.stackexchange.com/questions/152417/why-cant-i-use-public-private-key-authentication-with-ssh-on-arch-linux


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -