Set password in single command


 
Thread Tools Search this Thread
Operating Systems Linux Set password in single command
# 8  
Old 12-02-2010
What Linux system are you running?
The man pages for both SUSE and UBUNTU indicate that chpasswd update passwords in batch mode, so it is not interactive. It does not require any flag to be non-interactive.
# 9  
Old 12-02-2010
chpasswd works fine noninteractively as root. It just reads the user:pass pairs from stdin. For example, to change xyzzy's password:
Code:
echo "xyzzy:qwertyuiop" | chpasswd

Anyone but root needs to authorize themselves with PAM somehow, usually by password. This is as it should be I think. Obviously a powerful bulk password changing tool shouldn't be available to just anyone...

This may vary on your system if your PAM settings are different.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need one line command to create and set password for new user...

Using useradd abc --password password (5 Replies)
Discussion started by: Jagruti Rml
5 Replies

2. Solaris

Not able to set password

I have a Solaris-10 non global zone, on which I am not able to reset password, while counts are matching in /etc/passwd and /etc/shadow. I tried searching its solution in various forums, but nothing is working # id -a oemagent uid=56605(oemagent) gid=56595(tess) groups=56595(tess) # passwd -s... (2 Replies)
Discussion started by: solaris_1977
2 Replies

3. Shell Programming and Scripting

Script to set password in HP-UX 11.31

Hi, I am unable to set the password remotely. I am using the script as below: ep=`echo "$p" | /usr/lbin/makekey` ssh -t $i "/usr/local/bin/sudo useradd -c "$user_c" -m -d /home/$user_id -s /bin/ksh $user_id; /usr/local/bin/sudo /usr/sam/lbin/usermod.sam -F -p $ep $user_id" The... (0 Replies)
Discussion started by: Kits
0 Replies

4. AIX

How to set 4 SEA on single VIOS

Hi experts, i got a 4-port Adapter card on VIOS and would like to configure 4SEA for 4 difference segment IP client's LPAR use, first SEA succeed to be configured on ent0 but once second SEA configured, first SEA fail to be connected. Any issues i need to be concerned in order to configure 4 SEA on... (8 Replies)
Discussion started by: polar
8 Replies

5. Shell Programming and Scripting

How to give user name and password in a single command to login to remote server

Hello All, I'm new to unix and i need the below favour from you. I have list of 50 unix server. I need to login to all the server one by one and with the same user and password. I will declare the user name and password globally in the script. for example : servername- hyperV user name... (4 Replies)
Discussion started by: Hari A
4 Replies

6. AIX

Single user mode password

Hi, How to check whether the single user mode is password protected or not?By default, while entering in to single user mode, Os is not asking for login credentails. How can i enable it. Kindly help Rgds, kmvinay (2 Replies)
Discussion started by: kmvinay
2 Replies

7. HP-UX

Single quotes contained within a password

Are single quotes allowed in a UNIX password? With my understanding that UNIX interprets single quotes in pairs and has a distinct meaning to the shell that it removes special meaning of all enclosed characters. I wanted to confirm that a single quote within a password would fail for this reason. (4 Replies)
Discussion started by: roni13
4 Replies

8. Solaris

Not able to (re)set the Password

I have installed Solaris 10 x86 in VMware 5.5.I logged in as root user and trying to create new user and also reset the password for existing user, i am getting "Permission Denied Error". I checked the /etc/shadow file, looks fine permission is 400. Earlier i was able to do it but suddenly it... (2 Replies)
Discussion started by: khagendra
2 Replies

9. UNIX for Dummies Questions & Answers

Can we set it so people can't use the same password twice?

If we have it so users accounts need a new password after 90 days is there a way to also say that after 90 days they need to use a new password and not let them use the same one twice? (2 Replies)
Discussion started by: LordJezo
2 Replies

10. UNIX for Dummies Questions & Answers

Single line password reset.

Hi, I need to know if this command echo NEWPASSWORD | passwd --stdin USERNAME that works fine on Red Hat Linux, is also available on other Unix/Linux machines (AIX, FreeBSD, OpenBSD, SunOS, Mandrake, Debian, Gentoo, Lindows, Slackware, Xandros, HP-UX, IRIX, SCO, MacOS, BSDi ...). ... (2 Replies)
Discussion started by: margi973
2 Replies
Login or Register to Ask a Question