1

I have a server(ubuntu16.04) in aws ec2. And I have a private key to access the server. The origin user I used called ubuntu which is generated by aws. Now my client B wants to login server to synchronize(it's a window10 pc). I don't want to use my aws private key in different places. So I create a new user which has a limited right called syncusr.

$ cat /etc/passwd
syncusr:x:1002:1002::/home/syncusr:

I generated ssh-key (ssh-keygen) then append public key to authorized_keys in ~/.ssh

$ ls -ld ~/.ssh; ls -l ~/.ssh
drwx------ 2 syncusr syncusr 4096 May 15 12:14 /home/syncusr/.ssh
total 8
-rw-r--r-- 1 syncusr syncusr  404 May 15 12:13 authorized_keys
-rwxrwxrwx 1 syncusr syncusr 1679 May 15 12:13 id_rsa

Now I download id_rsa and run PuTTYgen got a private key, then I login from client B with username syncusr and private key but failed.

. 2020-05-15 12:17:00.335 Initialised AES-256 SDCTR (AES-NI accelerated) outbound encryption
. 2020-05-15 12:17:00.335 Initialised HMAC-SHA-256 outbound MAC algorithm
. 2020-05-15 12:17:00.335 Initialised AES-256 SDCTR (AES-NI accelerated) inbound encryption
. 2020-05-15 12:17:00.335 Initialised HMAC-SHA-256 inbound MAC algorithm
. 2020-05-15 12:17:00.507 Reading key file "D:\SSHKEY\private_key.ppk"
! 2020-05-15 12:17:00.507 Using username "syncusr".
. 2020-05-15 12:17:00.709 Server offered these authentication methods: publickey
. 2020-05-15 12:17:00.709 Offered public key
! 2020-05-15 12:17:00.901 Server refused our key
. 2020-05-15 12:17:00.918 Server refused our key
. 2020-05-15 12:17:00.918 Server offered these authentication methods: publickey
. 2020-05-15 12:17:00.918 No supported authentication methods available (server sent: publickey)
. 2020-05-15 12:17:00.918 Attempt to close connection due to fatal exception:
* 2020-05-15 12:17:00.918 No supported authentication methods available (server sent: publickey)

which part did I miss?

enter image description here

soltion:

drwx------ 2  /home/sync1/.ssh
total 8
-rw-r--r-- 1  authorized_keys
-rw------- 1  id_rsa
8
  • You should change the permission of id_rsa on server to chmod 700. That said, I think your problem is the key format. (How) did you convert id_rsa to private_key.ppk?
    – davidgo
    May 15, 2020 at 19:12
  • superuser.com/questions/912304/…
    – davidgo
    May 15, 2020 at 19:13
  • @davidgoI did convert id_rsa to ppk, and I think -rwxrwxrwx 1 syncusr syncusr 1679 May 15 12:13 id_rsa this line means I have the permission. May 16, 2020 at 2:06
  • I don't know much about putty, but in OpenSSH on Linux if your private key is rwxrwxrwx Openssh won't load it because it want to make sure its only readable by the owner.
    – davidgo
    May 16, 2020 at 2:33
  • 1
    The line you are showing as having permission exists on a file that should arguably not be on the server (but I don't think that's where the problem is)
    – davidgo
    May 16, 2020 at 2:34

0

You must log in to answer this question.

Browse other questions tagged .