Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 4766  / 3 Years ago, fri, august 27, 2021, 12:05:06

I try to check whether my root has password or not.



I run this command;



sudo passwd root


Later on it responses as;



Enter new UNIX password:


Based on that response, I have an indication that my root has no password.
Therefore I want to quit from the command process.



How can I do that, please?


More From » password

 Answers
5

To view if your root has a password set use:



sudo passwd -S root


This will print out a:




  1. P in the second column if it has a password;

  2. L in the second column if it has a locked password (a password which is impossible to type in) and L is the default on Ubuntu;

  3. NP if it has no password.



To get out of the new password dialog just type wrong passwords: Type a new password and when asked for confirmation for this new password type a different password. The passwords will not match and the program exits with an appropriate error message.



(You can't use signals to quit, because passwd ignores every signal. Except SIGKILL should work, but it is unnecessary and maybe insecure to use here.)


[#27325] Saturday, August 28, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
whoppinolo

Total Points: 93
Total Questions: 113
Total Answers: 107

Location: Cyprus
Member since Mon, Oct 24, 2022
2 Years ago
;