Create new user in AWS EC2
First of all user in your Instance
#sudo su
#adduser theitideas <-- keep password with you to fire command with sudo
Login with new user
#su theitideas
Generate private and public key for new user.
#ssh-keygen -t rsa
#cd /home/theitideas/.ssh/
#touch authorized_keys
#cat id_rsa.pub > authorized_keys
#exit
Make entry to your to access command with sudo in visudo file
#visudo <-- once this file open find "Allow members of group sudo to execute any command" and enter below mentioned line in that file then save and close.
theitideas ALL=(ALL:ALL) ALL
Provide below permissios
#chmod go-w /home/theitideas
#chmod 700 /home/theitideas/.ssh
#chmod 600 /home/theitideas/.ssh/authorized_keys
Now copy or download private (id_rsa)key from server to your local machine to login.
#cat id_rsa
All done now you can login with your private key (id_rsa) like below from your machine.
#ssh -i id_rsa theitideas@12.34.45.56
Hurray !!!! :)
First of all user in your Instance
#sudo su
#adduser theitideas <-- keep password with you to fire command with sudo
Login with new user
#su theitideas
Generate private and public key for new user.
#ssh-keygen -t rsa
#cd /home/theitideas/.ssh/
#touch authorized_keys
#cat id_rsa.pub > authorized_keys
#exit
Make entry to your to access command with sudo in visudo file
#visudo <-- once this file open find "Allow members of group sudo to execute any command" and enter below mentioned line in that file then save and close.
theitideas ALL=(ALL:ALL) ALL
Provide below permissios
#chmod go-w /home/theitideas
#chmod 700 /home/theitideas/.ssh
#chmod 600 /home/theitideas/.ssh/authorized_keys
Now copy or download private (id_rsa)key from server to your local machine to login.
#cat id_rsa
All done now you can login with your private key (id_rsa) like below from your machine.
#ssh -i id_rsa theitideas@12.34.45.56
Hurray !!!! :)