Sudoers in Centos

In our servers we don't have proper groups and No active Directory.
We are adding Users locally and providing users a public key, that's the way they can connect to the servers using .ppk file.

My manager ask me to prompt for a password based login when they try for Sudo. (Currently it was set up for no password in sudoers file)

Since we don't have a Password set up on these boxes is there any way we can achieve this task.

I am thinking as below:

  1. LDAP based authentication
  2. We can add a password locally in the /etc/passwd file in that way it will be encrypted and copied over to local server. then we can modify sudoers file to prompt for the password.

Please let me know is there any other way we can address this thank you for your valuable suggestions :slight_smile:

Thanks

AFAIK:
If you want the users to type a password for sudo , then they must have a password for their own account.
Where there is no password for one owns account, it cannot be entered upon sudo , however, one can have an account with password with a passwordless sudo.

Another idea, but i dont know how to implement, would be ssh-key files.
See: ssh-keygen and probably ssh-copy-id of openssh package for more details.

Hope this helps to get you started.

1 Like