$ ssh -p PORT ADMIN_USER@HOST
$ sudo groupadd USER
$ sudo useradd --home /home/USER --create-home --groups USER,docker --gid USER --shell /bin/bash USER
$ cd /home/USER
$ sudo mkdir .ssh
$ sudo cat USER_SSH_PUB_KEY >> .ssh/authorized_keys
$ sudo chown -R USER:USER .ssh
$ sudo chmod 700 .ssh/
$ sudo chmod 600 .ssh/authorized_keys
$ sudo chown -R USER:USER .ssh
Last active
July 26, 2020 15:02
-
-
Save TommyStarK/513c6ad2e4ca41b2c1cdf8ac6367349b to your computer and use it in GitHub Desktop.
Create new user on linux with ssh access and grant docker permissions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment