1

I tried to add a user which is able to authentificate using the keyfile authentification method to authentificate on a linux ubuntu machine. I tried now 2 full days but I failed to set this up. Here is what I've done so far:

  1. I added a user teamalpha and gave All rights in sudoes file
  2. I added .ssh (700) and authorized_keys (600) in user directory
  3. I changed the owner of the file and directory to the teamalpha user
  4. I added in authorizedKeyfile %h/.ssd/authorized_keys
  5. I placed the pub key generated by PuttyGen in the authorized_keys file. I did it the same way I have done it before for the root user. For root it works correct.
  6. with service ssh restart i restarted the ssh service

When I now try to login with teamalpha user I only get the failure message Server refused our Key

I tried now 2 full days many different shemes and setting. All failed. What is wrong there?

  • So let me clarify : You are using the same public & private key for this new "teamalpha" user as you did for root, which worked with root? I have done this; it should work. Are you using a different "saved settings" in putty? Have you set up the new connection to point to your private key ? This is the only thing that I don't really see in your description of what you did. The private key (which corresponds to the public key in .~/ssh/authorized_keys) must be in the saved connection settings in your putty client for the session that takes you to that system/account. – PatrickTaylor Jan 29 '19 at 05:28
  • One other thing .. do check for line breaks in authorized_keys. If you edit with vi, pressing $ (not in insert mode) should take you to end-of-line. For a correct key entry this should be the end of the key. – PatrickTaylor Jan 29 '19 at 05:32
  • I don't use any saved settings in putty. I use the same settup for root and it works fine. I type in ip of the server and select the private key in putty. After this i type in the username teamalpha in the ssh login shell. If I do the same with root it works fine. I use for testing purpose exacktly the same private key and also the same public key which i placed in %h/..ssh/authorized_keys. I also added the line AllowUsers Teamalpha root and finally I made sure that user teamalpha has bin/bash I also always restarted ssh with service ssh restart. Also the key has no line breaks. – Oscar Schreyer Feb 01 '19 at 00:03
  • I studied the auth.log carefully but I can not understand the given information there. – Oscar Schreyer Feb 01 '19 at 00:14

0 Answers0