Access Denied while logging in via SSH (PuTTY)

67,860

You want to add tempuser to your sshd_config file.

To do so at a prompt:

sudo nano /etc/ssh/sshd_config

Look for a line that, by default, reads: #AllowUsers; you want to change it to (or add it, if it doesn't exist, as) AllowUsers tempuser

Save the file - in nano it's Ctrl+O (that's the capital letter "o") then Ctrl+X to quit, then type sudo service sshd restart to load the new config.

Share:
67,860

Related videos on Youtube

Muhnamana
Author by

Muhnamana

Phillies, Flyers, Eagles, Tech & video game junkie.

Updated on September 18, 2022

Comments

  • Muhnamana
    Muhnamana over 1 year

    I'm having trouble logging in to my server via ssh (PuTTY) on a new username that I created.

    During the initial installation of the server, I set up a username of "admin". While logged in as "admin" I ran the following command: sudo useradd tempuser, then entered the password for the new username.

    From my Windows box, I connect to the server and enter the new username, "tempuser", and hit Enter. Now it asks for the password. I've entered it successfully a couple of times and I receive the error Access denied each time.

    Do I have to add this new user somewhere else in order to log in via SSH?

    • nerdwaller
      nerdwaller over 11 years
      Depends on your /etc/ssh/sshd_config. If you have the option AllowUsers defined, you'd need it there for sure. sshd manpage
    • Muhnamana
      Muhnamana over 11 years
      Thank you...you sparked something there. I remember editing the sshd_config for something, its been awhile. I'll take a look, thanks again!
    • Muhnamana
      Muhnamana over 11 years
      Yep sure enough, tempuser was not defined in the AllowUsers entry. Thanks again!
    • nerdwaller
      nerdwaller over 11 years
      Glad to hear it, good learning experience!