linux setup
Create a New Sudo User
To add a new sudo user, open the terminal window and enter the command:
Use the actual username for your new user in place of UserName.
Next, create a password for the new user by entering the following in your terminal window:
The system should display a prompt in which you can set and confirm a password for your new user account. If successful, the system should respond with “all authentication tokens updated successfully.”
Add User to Group
To add a user to the wheel group, use the command:
As usual, replace UserName with the name of the user receiving sudo privileges.
Step: 3 Switch to the Sudo User
Switch to the new (or newly-elevated) user account with the su
(substitute user) command:
Enter the password if prompted. The terminal prompt should change to include the UserName.
By default, AWS ec2 instances don’t have password authentication. You have to use the private key to connect to the instances. However, you might have situations to use password-based authentication for your AWS ec2 instances.
In this tutorial, we have done the configuration to enable password authentication in AWS instance.
Step 1:
Login to AWS instances
ssh -i your-key.pem username@ip_address
Step 2: Setup a password for the user using passwd command along with the username.
sudo passwd ubuntu
Step 3: Edit sshd_config file.
sudo vim /etc/ssh/sshd_config
Find the Line containing 'PasswordAuthentication' parameter and change its value from 'no' to 'yes'
PasswordAuthentication yes
If you want to set up 'root' login, find 'PermitRootLogin' parameter and change its value from 'prohibit-password' to 'yes'
PermitRootLogin yes
After this changes save file and exit. Step 4: Restart the SSH service.
service ssh restart ## for ubuntu service sshd restart ## for centos
Step 5: Now we can log in using the password you set for the user. For example,
ssh ubuntu@54.224.72.66
Last updated
Was this helpful?