unix/mac questions about password changes or storage, the related `.passwd` file or `passwd` command
Questions tagged [passwd]
140 questions
3
votes
2 answers
How do I generate an encrypted password string, as it is in /etc/shadow?
I'm trying to mimic the creation of password strings as they appear in /etc/shadow.
This is what I've got so far, but the encrypted passwords don't match, when I use the same password and the same salt.
5000 rounds is standard for crypt, so I used…

polemon
- 4,722
- 3
- 37
- 48
3
votes
2 answers
Mojolicious and Passwd::Unix
I'm trying to return the list of Unix users on this perl script. I'm using the Mojolicious framework with Passwd::Unix.
References:
Mojolicious (http://metacpan.org/pod/Mojolicious)
Passwd::Unix (http://metacpan.org/pod/Passwd::Unix)
That's my…

Caio Tarifa
- 5,973
- 11
- 46
- 73
3
votes
9 answers
Using shell_exec('passwd') to change a user's password
I need to be able to change the users' password through a web page (in a controlled environment).
So, for that, I'm using this code:

RSilva
- 6,753
- 11
- 43
- 49
2
votes
1 answer
Docker set user password non-interactively
I would like to set my user vault's password in the Dockerfile and I have tried
RUN echo -e "pass\npass" | passwd "${USER}"
but get
Enter new UNIX password: Retype new UNIX password: Sorry, passwords do not match
passwd: Authentication token…

stdcerr
- 13,725
- 25
- 71
- 128
2
votes
1 answer
Got error "passwords do not match" using passwd in docker
I wanna create a user had random password for FTP in Docker. The section of Dockerfile like below:
RUN useradd web
RUN export ftppass=`cat /proc/sys/kernel/random/uuid`
RUN echo -e "$ftppass\n$ftppass" | passwd web
But I got an error in last…

pea3nut
- 1,634
- 3
- 11
- 15
2
votes
2 answers
How to modify standard linux commands?
I am looking for a way to edit the source code of common Linux commands (passwd, cd, rm, cat)
Ex. Every time the 'cat' command is called (by any user), it performs its regular function, but also prints "done" to stdout after.

The doobverse
- 21
- 4
2
votes
2 answers
Use chef to run bash passwd
I am having a hard time figuring out how to use chef to run a bash command (passwd)
I know how to set up the bash resource block but how do I set it up so that is will take the variable password = 'abc123'. The user I want to do it for is adminblah…
user9753902
2
votes
1 answer
How do I use expect to connect via ssh to a system and change the password of the host system?
I am automating the process of:
Connect to a system named "alpha" via ssh with password "alpha" for username "alpha". Once connected I would like to set the root password (to "kickass"). The system I am connecting to doesn't have a root password by…

fzkl
- 977
- 3
- 11
- 17
2
votes
1 answer
Change password at Linux Snappy Ubuntu Core
I wanted ask you, how add user into Snappy Ubuntu Core.
When I downloaded image of Ubuntu Core, there was user "ubuntu" with password "ubuntu" and sudo group. I'll write it with small tutorial (commands) for these who try to deal with same…

Payne
- 456
- 6
- 21
2
votes
1 answer
should my program lock /etc/.pwd.lock when reading /etc/passwd?
I'm writing some program that reads /etc/{passwd,group}.
I learned that any program should lock /etc/.pwd.lock by calling lckpwdf() before writing the above files so that write collisions can be avoided.
I guess reading operation also needs this…

fpemud
- 363
- 3
- 10
2
votes
2 answers
LDAP users not able to change their password using passwd command
I have a basic LDAP setup without SSL configured. Users are able to login but not able to change their password using passwd command. I have gone though many blogs but no luck. I have disabled selinux and iptables.
Any help on this will be much…

Krishnamurthy Dasari
- 23
- 1
- 1
- 4
2
votes
3 answers
unix home directories without entries in /etc/passwd
I am able to get both listings ( /etc/passwd and /home ) but how to script something like read line of /etc/passwd, parse home directory, then look for that in /home . If it doesn't exist, throw an error, if it does exist, move along.
/etc/passwd…

mohuddle
- 23
- 6
2
votes
1 answer
error message Unknown user name 'root' when changing password
I mounted a guest centos system and changed inittab file to single user mode. Then I unmounted it and used virsh console to access the guest system in single user mode. However I got 'unknown user name' message as following:
[root@guest34 /]# passwd…

Purres
- 1,271
- 2
- 11
- 12
2
votes
2 answers
C++ Passwd, Root Priviledges
I have written a c++ script that disables or enables users within a Solaris environment. This is done by calling the passwd through
sprintf(cmd, "/usr/bin/passwd -l %s", argv[1]);
However the script is not executed by root, but by another…
user2428994
1
vote
3 answers
What are ideal /etc/passwd file permissions?
Is there any risk keeping open world-read access to passwd file?
Why is by default passwd file world-readable

user1295164
- 27
- 1
- 2