CHANGE AWS AUTHENTICATION FOR UBUNTU

change PasswordAuthentication no to yes

$ sudo vi /etc/ssh/sshd_config
PasswordAuthentication yes

restart ssh

$ sudo service restart ssh

if above line doesn’t work, try this

$ /etc/init.d/ssh restart

add new user

$ sudo useradd -s /bin/bash -m -d /home/msen23 -g root msen23

add password for msen23 user

$ sudo passwd msen23
Enter new UNIX password: blablabla
Retype new UNIX password: blablabla

let’s make msen23 one of the sudoers

$ sudo chmod -w /etc/sudoers
$ sudo vi /etc/sudoers

add this under the place where you see root = (ALL:ALL) ALL

msen23 ALL=(ALL) ALL

now change the file back to read-only mode

$ sudo chmod +w /etc/sudoers

just in case you want to lock user account

$ sudo passwd -l msen23

to unlock the account password

$ sudo passwd -u msen23

you might need to change your web document root directory permission

for nginx

$ sudo chown msen23 /usr/share/nginx/html/

for apache

$ sudo chown msen23 /var/www/html/

Additional Commands

list all users

$ compgen -u
root
daemon
bin
sys
sync
games
man
lp
mail
news
uucp
proxy
www-data
backup
list
irc
gnats
nobody
libuuid
syslog
messagebus
landscape
sshd
pollinate
ubuntu
mysql
msen23

list all groups

$ compgen -g

which users are logged in

$ w

or

$ who

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