0

I need to add an account for someone to be able to SSH into my server and have sudo privileges. He has given me his pubkey which is something like:

ssh-rsa AAAAfbfi40fdsfodudksjflksjdf..... name@workstation 

I'm really not sure what to do with this key. I can find a way to create a new user for SSH but what's the point of this pubkey and how can I use it to make an account for him?

1 Answer 1

2

You will need to un-comment this line from /etc/sudoers Allows people in group wheel to run all commands

%wheel ALL=(ALL) ALL 

Then these would be the steps to add a user

useradd -d /home/user -G wheel user mkdir /home/user/.ssh echo "ssh-rsa dfgsdfgsfdgsdfg" > /home/user/.ssh/authorized_keys chown -R user.user/home/user/ chmod -R o-rwx /home/user/.ssh 

You will need to also ensure the following options are set in the /etc/ssh/sshd_config

 PubkeyAuthentication yes AuthorizedKeysfile .ssh/authorized_keys 
2
  • Firstly thank you for your help! So, in my 'sudoers' file there is not a %wheel anywhere, only root, %sudo, %admin. Also there already is a folder called .ssh and it contains authorized_keys, do I just paste his key at the end of that file? Commented Jun 24, 2015 at 15:17
  • Is this a debian/ubuntu server? If so then this will be the guide you need to use. digitalocean.com/community/tutorials/… Commented Jun 24, 2015 at 15:43

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.