Questions tagged [passwd]

unix/mac questions about password changes or storage, the related `.passwd` file or `passwd` command

140 questions
0
votes
2 answers

PHP passwd error

I'm doing this: $user = 'kevin'; $pass = 'nivek'; shell_exec('echo -e "' . $pass . '\n' . $pass . '" | sudo passwd ' . $user);` But when I execute this, I get this error: Enter new UNIX password: Retype new UNIX password: Sorry, passwords do not…
www.data-blogger.com
  • 4,076
  • 7
  • 43
  • 65
0
votes
0 answers

Bash redirecting the output form passwd to be used by grep to verify a correct password change

as the title says I am trying to get the output when running passwd to verify that the password had changed correctly and by stopping passwd from outputting everything to the terminal. Some background, I am trying to write a script that will go…
ZerkerEOD
  • 25
  • 6
0
votes
1 answer

Linux custom NSS module, `_nss_SERVICE_getspnam_r` is called but `_nss_SERVICE_getpwnam_r` is not

I'm creating a custom NSS module. I managed to make it work on my local Redhat 7.3 box, configured nsswitch.conf correctly passwd: files SERVICE shadow: files SERVICE and confirmed that both _nss_SERVICE_getpwnam_r and _nss_SERVICE_getspnam_r are…
terencezl
  • 69
  • 1
  • 8
0
votes
1 answer

how to run "sudo passwd username" noninteractively

In a shell script with sudo privileges, I'm trying to change another users password. I tried sudo passwd username but didn't get anywhere.
american-ninja-warrior
  • 7,397
  • 11
  • 46
  • 80
0
votes
1 answer

Why chroot passwd in CentOS 7.3 is no longer working? 7.0 was OK

I was trying to change password of a CentOS 7.3 virtual machine by the rootjail mechanism. I used to mount the vm's disk on host and then type in chroot /mountpoint passwd, but this time the vm's password remained unchanged. I can recall that every…
Bob
  • 105
  • 1
  • 12
0
votes
1 answer

After change home directory, ask password with ssh

Just created a new user B on CentOS 6.8 and set public key of Ubuntu 16's user A to B's authorized_keys. Works fine. NOT ask password through ssh connection. After change B's home directory (in /etc/passwd/ : /home/B > /user/B), ask B's password.…
enowy
  • 11
  • 3
0
votes
1 answer

Invalid shadow entry with pwck -r

I'm trying to verify integrity of password files using the following command : pwck -r It seems that the checking of /etc/passwd is ok but nor for the /etc/shadow And I get this error : Invalid shadow entry. Delete line…
caps lock
  • 511
  • 3
  • 7
  • 20
0
votes
1 answer

Linux,I want to set user passwd which contains the username,How to set passwd policy?

I hava know a litter about linux passwd policy,I have establish a new user useradd testuser And I want to set the testuser's passwd as abtestuserab I input passwd testuser the input abtestuserab It's failded,the terminal reported BAD PASSWORD:…
elsonwx
  • 1,431
  • 3
  • 16
  • 26
0
votes
2 answers

expect doesn't pass input to passwd in bash script

I'm attempting to pass the $PASSWORD variable contents into passwd using expect. This appears to work, adding the users but once you attempt to log in via ssh with one of the users, it doesnt work. If i set the password manually, it's then fine.…
Detnon
  • 21
  • 5
0
votes
3 answers

read username from modified /etc/passwd file using a script

I want to read the users from /etc/passwd file.My /etc/passwd file is /etc/passwd root:eRYFFjZ2./oo:0:0:root:/:/bin/bash nobody:*:99:99:Nobody:/: ftp:*:14:50:FTP…
Adhz
  • 55
  • 7
0
votes
1 answer

passwd: Authentication failure on redhat

I have an application (APP1) which can only be executed by a user with root privileges but not by root. Hence I have created another user root1 : adduser -u 0 -o -g 0 -G 0,1,2,3,4,6,10 -M root1 And then when I am trying to assign a password to this…
hits_lucky
  • 327
  • 2
  • 9
  • 18
0
votes
1 answer

Script to generate MD5 hash with openssl

I'm trying to generate some MD5 hashes with openssl for use with chpasswd Ex. CSV file: Sample,User,SU,,sauser,password Test,User,TU,,teuser,password User, T Test,TEST,,username,password Script I created: #!/bin/bash file=$(readlink -f "$1") # open…
에이바바
  • 1,011
  • 11
  • 36
  • 60
0
votes
1 answer

Linux passwd command : formatting the ouput

I have this script in which a user can change its password using passwd transparently. The script itself is executed by root, launching it with su - -c "script" I know it might not be very safe a way to launch the script but that is how it…
Vartaghan
  • 1
  • 1
0
votes
2 answers

Windows Server 2012 R2 NFS identity mapping linux client

I'm trying to identity map a Ubuntu 12.04 machine to a NFS share on a Windows 2012 R2 machine. I have a limited amount of Ubuntu machines, all with the same user. This: States that I can identity map if I create a passwd and group file…
iinertiaii
  • 81
  • 2
  • 10
0
votes
1 answer

How linux passwd command is making sure that it can't modify other user's password from an unprivileged account

I know, passwd has setuid bit set and hence it can modify root owned /etc/shadow file. [~]$ ls -l `which passwd` -rwsr-xr-x. 1 root root 27832 Jan 29 2014 /usr/bin/passwd But how it is making sure that it can modify only the current account's…