Quantcast
Channel: CodeSection,代码区,Linux操作系统:Ubuntu_Centos_Debian - CodeSec
Viewing all articles
Browse latest Browse all 11063

Adding a New User (Sudoer) & SSH Key in Ubuntu

$
0
0
byFrancis Kim inRandom posted November 29, 2016

Right now I’m having to create multiple users on multiple Ubuntu instances, I hope the following steps will be of use to someone. Although it’s for Ubuntu it should be the same process for all linux and most *nix OS’s.

# (running as root) useradd -m foobar adduser foobar sudo cd /home/user/foobar mkdir .ssh chown foobar:foobar .ssh && chmod 700 .ssh cd .ssh vim authorized_keys # (paste in the public SSH key) chown foobar:foobar authorized_keys && chmod 600 authorized_keys passwd foobar # (set a temporary password, get the user to change it) service ssh restart

The above commands will correctly set the permission and file/directory owner.


Viewing all articles
Browse latest Browse all 11063

Trending Articles