I have read through a number of sites to no avail. So I need to see if someone else can see what I am doing wrong.
I am using ubuntu 18. Here is ssh -v output:
debug1: Found key in /home/leithner/.ssh/known_hosts:1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:5nOs3DjENMsvwbU2jHNE2GOv6u/1L5TyFCgc3zPYNDM /home/leithner/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/leithner/.ssh/id_dsa
debug1: Trying private key: /home/leithner/.ssh/id_ecdsa
debug1: Trying private key: /home/leithner/.ssh/id_ed25519
debug1: Next authentication method: password
ssh with port output:
Host '[elm.pa...]:53999' is known and matches the ECDSA host key.
debug1: Found key in /home/leithner/.ssh/known_hosts:1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:5nOs3DjENMsvwbU2jHNE2GOv6u/1L5TyFCgc3zPYNDM /home/leithner/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/leithner/.ssh/id_dsa
debug1: Trying private key: /home/leithner/.ssh/id_ecdsa
debug1: Trying private key: /home/leithner/.ssh/id_ed25519
debug1: Next authentication method: password
From /var/log/auth.log file:
Aug 19 14:44:55 birch sshd: Accepted publickey for leithner from 129.244.22.126 port 57912 ssh2: RSA SHA256:qLTekbB8a22YWHqRHPZjVSJ0dNEHTSoI3nFN97PEyuc
Aug 19 14:44:55 birch sshd: pam_unix(sshd:session): session opened for user leithner by (uid=0)
Aug 19 14:44:55 birch systemd-logind: New session 38875 of user leithner.
Aug 19 14:45:01 birch CRON: pam_unix(cron:session): session opened for user root by (uid=0)
Aug 19 14:43:44 birch sshd: pam_unix(sshd:session): session closed for user leithner
Aug 19 14:44:55 birch sshd: Accepted publickey for leithner from 129.244.22.126 port 57912 ssh2: RSA SHA256:qLTekbB8a22YWHqRHPZjVSJ0dNEHTSoI3nFN97PEyuc
Aug 19 14:44:55 birch sshd: pam_unix(sshd:session): session opened for user leithner by (uid=0)
Aug 19 14:44:55 birch systemd-logind: New session 38875 of user leithner.
Aug 19 14:45:01 birch CRON: pam_unix(cron:session): session opened for user root by (uid=0)
Aug 19 14:45:01 birch CRON: pam_unix(cron:session): session closed for user root
Aug 19 14:47:25 birch sshd: Received disconnect from 129.244.22.126 port 57912:11: disconnected by user
.ssh directory
directory permissions are drwx------ 2 leithner users 4096 Aug 19 15:27 .ssh
leithner@birch:~/.ssh$ ls -l
total 20
-rw------- 1 leithner users 394 Aug 19 14:43 authorized_keys
-rw------- 1 leithner users 26 Aug 19 15:23 config
-rw------- 1 leithner users 1675 Aug 19 15:26 id_rsa
-rw------- 1 leithner users 396 Aug 19 15:26 id_rsa.pub
-rw------- 1 leithner users 888 Aug 19 15:28 known_hosts
.ssh directory on server
directory permissions on server are: drwx------ 2 leithner ppa 4096 Aug 19 14:27 .ssh
leithner@elm:~/.ssh$ ls -l
total 20
-rw------- 1 leithner ppa 396 Aug 19 14:27 authorized_keys
-rw------- 1 leithner ppa 85 Aug 19 14:23 config
-rw------- 1 leithner ppa 1823 Aug 19 13:36 id_rsa
-rw------- 1 leithner ppa 394 Aug 19 13:36 id_rsa.pub
-rw------- 1 leithner ppa 1992 Aug 19 14:20 known_hosts
I created keys with ssh-keygen and copied them to server with ssh-copy-id leithner@elm
Ssh is requesting a password instead of using keys.
ssh -p 53997 elm
leithner@elm's password:
Here is the auth.log on server:
Aug 22 11:59:03 elm sshd: Authentication refused: bad ownership or modes for directory /home/leithner
Aug 22 11:59:12 elm sshd: Accepted password for leithner from 129.244.22.120 port 43340 ssh2
What permissions should my directory be:
**Solved:
The issues is my home directory was 775 it needs to be 755.
drwxr-xr-x 24 leithner ppa 4096 Aug 22 12:55 leithner**
Any ideas would be appreciated, I have redone the keys multiple times.
Asked by Sherry Sparks Leithner
(11 rep)
Aug 19, 2022, 08:00 PM
Last activity: Aug 22, 2022, 06:01 PM
Last activity: Aug 22, 2022, 06:01 PM