Archive for January, 2013

Fresh Ubuntu useradd (for completeness and handiness)

January 23, 2013

scp newuname.pub URL:
ssh URL

sudo su
useradd -m -s /bin/bash newuname
cp /etc/sudoers.d/90-cloudimg-ubuntu /etc/sudoers.d/91-newuname
vi /etc/sudoers.d/91-newuname

:%s/ubuntu/newuname/g
:wq!

cat /etc/sudoers.d/91-newuname
/etc/init.d/sudo restart
su newuname
ssh localhost

yes

sudo su
exit
exit
mv newuname.pub /home/newuname/.ssh/authorized_keys
chmod 600 /home/newuname/.ssh/authorized_keys
chown newuname:newuname /home/newuname/.ssh/authorized_keys

Advertisements