How do I use PuTTY to log in to a non-root user on Ubuntu 16.04?

I’ve followed the tutorial on setting up my droplet and installed a SSH key while creating my droplet. Since I’m using Windows, I have been using PuTTY to connect to my server; but I always log in as the root user and not the non-root sudo user I created. How do I create a profile on PuTTY that uses my sudo user instead?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

when saving session in PuTTY, click data from the left panel and put the non-root username in auto-login username field and save.


Which tutorial did you follow?

I’ll use username as the username in this example.

1). Create the users home directory and the .ssh directory where we’ll store the users’ key.

mkdir -p /home/username/.ssh

2). Add the user and set their home directory to the one we just created.

useradd -d /home/username username

3). Add the user to the sudo group.

usermod -aG sudo username

4). Create our authorized_keys file.

touch /home/username/.ssh/authorized_keys

5). Setup proper permissions on the .ssh directory, authorized_keys file, and home directory.

chmod 700 /home/username/.ssh
chmod 644 /home/username/.ssh/authorized_keys
chown -R username:username /home/username

6). Now you need to paste in your public key to the authorized_keys file located here:


At this point, you should be able to login via SSH if everything is configured correctly.