My permissions look like this:
-rw-------. 1 smpadmin staff 400 May 21 2014 id_rsa.pub
-rw-r--r--. 1 smpadmin staff 505 Dec 14 19:19 known_hosts
drwxr-xr-x. 45 smpadmin staff 4096 Jan 20 09:53 ..
-rw-r--r--. 1 smpadmin staff 386 Jan 20 10:32 config
-rwx------. 1 smpadmin staff 400 Jan 20 10:34 authorized_keys
-rwx------. 1 smpadmin staff 400 Jan 20 10:37 authorized_keys2
drwx------. 2 smpadmin staff 4096 Jan 20 10:37 .
The log:
debug3: record_hostkey: found key type RSA in file /home/alejanpi/.ssh/known_hosts:85
debug3: load_hostkeys: loaded 1 keys from x.x.150.86
debug1: Host 'x.x.150.86' is known and matches the RSA host key.
debug1: Found key in /home/alejanpi/.ssh/known_hosts:85
debug2: bits set: 1525/3072
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/alejanpi/.ssh/id_rsa (0x60005ff50),
debug2: key: /home/alejanpi/.ssh/id_dsa (0x0),
debug2: key: /home/alejanpi/.ssh/id_ecdsa (0x0),
debug2: key: /home/alejanpi/.ssh/id_ed25519 (0x0),
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug3: start over, passed a different list publickey,gssapi-keyex,gssapi-with-mic,password
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/alejanpi/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /home/alejanpi/.ssh/id_dsa
debug3: no such identity: /home/alejanpi/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /home/alejanpi/.ssh/id_ecdsa
debug3: no such identity: /home/alejanpi/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /home/alejanpi/.ssh/id_ed25519
debug3: no such identity: /home/alejanpi/.ssh/id_ed25519: No such file or directory
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
smpadmin@x.x.150.86's password:
I added the public key to both authorized key files.
By comparing to another server where I have the same keys working, the logs on this one show at some point:
Server accepts key: pkalg ssh-rsa blen 277
I also noticed a different hex code in this part of the logs:
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/alejanpi/.ssh/id_rsa (0x60006c5f0),
Now, for the server where my keys are not working, /home used to be on /, but I mounted it to a different disk. My keys used to work before I moved /home. Not sure if this is affecting me, but I thought it'd be worth mentioning. This is how I mounted home:
UUID=143f3a8a-55f3-41e4-8797-d1cdb0435c13 /home ext4 defaults 0 2
SELinux permissions.
drwx------. smpadmin staff unconfined_u:object_r:ssh_home_t:s0 .
drwxr-xr-x. smpadmin staff unconfined_u:object_r:user_home_dir_t:s0 ..
-rwx------. smpadmin staff unconfined_u:object_r:ssh_home_t:s0 authorized_keys
-rwx------. smpadmin staff unconfined_u:object_r:ssh_home_t:s0 authorized_keys2
-rw-r--r--. smpadmin staff unconfined_u:object_r:ssh_home_t:s0 config
-rw-------. smpadmin staff unconfined_u:object_r:ssh_home_t:s0 environment
-rw-------. smpadmin staff unconfined_u:object_r:ssh_home_t:s0 id_rsa.pub
-rw-r--r--. smpadmin staff unconfined_u:object_r:ssh_home_t:s0 known_hosts
The home directory has: drwxr-xr-x. root root system_u:object_r:file_t:s0 home
/var/log/secure
file? Post the most recent entries from the failure. – devnull Jan 20 '16 at 18:05ls -l ~/.ssh
at the top of your question the directory on the server? Please provide the same listing for the client as it could be permissions issue. Or perhaps you're missing the private key on the client. Also, is the debug listing from the server or the client? Please could you [edit] your question to make it clear which parts are from the client and which are from the server. Thanks. – Chris Davies Jan 20 '16 at 18:56restorecon -R -v ~/.ssh
– Gilles 'SO- stop being evil' Jan 20 '16 at 22:48