Fresh Ubuntu useradd (for completeness and handiness)

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: