LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Setting Passwd of User from command line.... (https://www.linuxquestions.org/questions/linux-newbie-8/setting-passwd-of-user-from-command-line-685958/)

nirmit 11-25-2008 07:26 AM

Setting Passwd of User from command line....
 
hi

i want to change user passwd from a single line(i.e no need to enter a passwd 2 times as with passwd command).


So plese help me for this...

rayfordj 11-25-2008 07:46 AM

Do you really want your password on the CLI in clear-text and in your history?

Code:

echo "Sup3R$3kre7" | passwd --stdin nirmit
passwd --help
man passwd

salter 11-25-2008 08:47 PM

I don't know what the purpose is for your request, but I guess that it has to do with changing a lot user passwords at once. In such a case (depending on the amount of users) you might just as well create a shell script to tinker with the passwd and shadow files directly. Dangerous, but possible.

Telemachos 11-25-2008 09:19 PM

Quote:

Originally Posted by rayfordj (Post 3353763)
Do you really want your password on the CLI in clear-text and in your history?

Code:

echo "Sup3R$3kre7" | passwd --stdin nirmit
passwd --help
man passwd

Interesting: I thought I was nuts because I had never seen that option before. I checked, and on my Debian system, there is no --stdin option. On a Mac, the option appears in the man page, but it doesn't actually work. (Every time I try it, I get an "illegal option" error.) The Mac version also helpfully offers a -noverify option, but that doesn't work either. Odd.

nirmit 11-25-2008 10:52 PM

Quote:

Originally Posted by rayfordj (Post 3353763)
Do you really want your password on the CLI in clear-text and in your history?

Code:

echo "Sup3R$3kre7" | passwd --stdin nirmit
passwd --help
man passwd


no after resetting the password i will erase all hisory and also from .bash_history

and THANK YOU.it really works in RHEL 3.0 as i have it in my server.


All times are GMT -5. The time now is 10:50 AM.