[ncolug] Re: /etc/shadow !! in password file

  • From: Mike <bellyacres@xxxxxxxxx>
  • To: ncolug@xxxxxxxxxxxxx
  • Date: Thu, 20 Jun 2013 13:03:23 -0400

On 06/20/2013 10:49 AM, M. Knisely wrote:
I know that the ! can mean that the password field is blank or disabled... what I need to do is to use the passwd command to get it to write a !! in the password field of /etc/shadow.

Any suggestions?

Mike K.

PS:  Yes, I have googled it... extensively.
PPS: Yes, I know I can, as root, edit /etc/shadow and do it manually. Trust me when I say that there are reasons I don't want to do that unless I absolutely have to.

Here is a way....

mike@tightrope:~$ apropos passwd
chgpasswd (8)        - update group passwords in batch mode
chpasswd (8)         - update passwords in batch mode
Crypt::PasswdMD5 (3pm) - Provides interoperable MD5-based crypt() functions
exim4_passwd (5)     - Files in use by the Debian exim4 packages
exim4_passwd_client (5) - Files in use by the Debian exim4 packages
gpasswd (1)          - administer /etc/group and /etc/gshadow
grub-mkpasswd-pbkdf2 (1) - generate hashed password for GRUB
lppasswd (1)         - add, change, or delete digest passwords.
makepasswd (1)       - generate and/or encrypt passwords
mkpasswd (1)         - Overfeatured front end to crypt(3)
mksmbpasswd (8)      - formats a /etc/passwd entry for a smbpasswd file
pam_localuser (8)    - require users to be listed in /etc/passwd
passwd (1)           - change user password
passwd (1ssl)        - compute password hashes
passwd (5)           - the password file
smbpasswd (5)        - The Samba encrypted password file
smbpasswd (8)        - change a user's SMB password
update-passwd (8)    - safely update /etc/passwd, /etc/shadow and /etc/group
mike@tightrope:~$

mike@tightrope:~$ man chpasswd

mike@tightrope:~$ script
Script started on Thu 20 Jun 2013 12:42:53 PM EDT
mike@tightrope:~$ sudo adduser iputz
[sudo] password for mike:
Adding user `iputz' ...
Adding new group `iputz' (1001) ...
Adding new user `iputz' (1001) with group `iputz' ...
Creating home directory `/home/iputz' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for iputz
Enter the new value, or press ENTER for the default
    Full Name []: Ima Putz
    Room Number []:
    Work Phone []:
    Home Phone []:
    Other []:
    Other []:
Is the information correct? [Y/n]
mike@tightrope:~$ sudo grep iputz /etc/passwd /etc/shadow
/etc/passwd:iputz:x:1001:1001:Ima Putz,,,:/home/iputz:/bin/bash
/etc/shadow:iputz:$6$vrgqeJNq$GF2OckxPdW5eJvM/Tu3avSBN73tT10e5VFhoH6MiRGcHOpEumuMsbXOOrFsh0Gr0N3BLddMzYc5bM8ggvFi4M0:15876:0:99999:7:::
mike@tightrope:~$ echo 'iputz:!!' | sudo chpasswd -c NONE
sudo grep iputz /etc/passwd /etc/shadow
/etc/passwd:iputz:x:1001:1001:Ima Putz,none,,:/home/iputz:/bin/bash
/etc/shadow:iputz:!!:15876:0:99999:7:::
mike@tightrope:~$ exit
Script done on Thu 20 Jun 2013 12:51:23 PM EDT
mike@tightrope:~$


To unsubscribe send to ncolug-request@xxxxxxxxxxxxx with 'unsubscribe' in the 
Subject field.

Other related posts: