Question

going around in circles trying to setup Ubuntu

Hi I have installed the latest version of ubuntu 15.04 and have tried to follow this guide

https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-14-04

this is what I have done adduser mike2099 Adding user mike2099' ... Adding new group mike2099’ (1000) … Adding new user mike2099' (1000) with group mike2099’ … Creating home directory /home/mike2099' ... Copying files from /etc/skel’ … Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully Changing the user information for mike2099 Enter the new value, or press ENTER for the default Full Name []: Mike Room Number []: Work Phone []: Home Phone []: Other []: Is the information correct? [Y/n] y root@mikejsaunders:~# gpasswd -a mike2099 sudo Adding user mike2099 to group sudo root@mikejsaunders:~# su mike2099 mike2099@mikejsaunders:/root$ mkdir .ssh mkdir: cannot create directory ‘.ssh’: Permission denied

I presumed the directions for the newer version would work the same

this is the 3rd time I have tired this and I get the same error every time, I have setup an ssh key already and when I create the droplet I am adding it, based on the instructions I should add the key to the new user in order to secure the new users account ? or have I missed something

thanks Mike

Subscribe
Share

You add the user mike2099 to the sudo group, then switch to that user and try to create a folder in the root users folder. You need to create the .ssh folder in the /home/mike2099 folder not the /root folder.


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

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.

You’re trying to create the .ssh/ directory within the root user’s folder as the user “mike2099” and because “mike2099” doesn’t have permissions to write in the root user’s folder, you’re getting a permission denied error.

From what I can gather you’re trying to add an SSH key to mike2099 following a tutorial, to fix the error, cd in to mike2099’s home folder with cd before you run mkdir .ssh and the tutorial should work as expected.