Creating User

You have to create a user “training” and set its password “password”

Add user in CentOS, open a terminal

sudo useradd training

Assign a password using passwd command and set the password: “password”

sudo passwd training

Edit the sudoers file through vi command

sudo vi /etc/sudoers

You have to follow either of the 2 options

  1. Add a new highlighted line in this file

training ALL=(ALL) NOPASSWD: ALL

2. Replace # %wheel with training in the above line.

Once this is done, save the file using Esc :wq!

Set PasswordAuthentication as yes and restart ssh daemon

sudo vi /etc/ssh/sshd_config

Uncomment PasswordAuthentication yes and comment the PasswordAuthentication no

sudo systemctl restart sshd.service

Last updated