LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-25-2008, 07:26 AM   #1
nirmit
Member
 
Registered: Feb 2008
Posts: 73

Rep: Reputation: 15
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...
 
Old 11-25-2008, 07:46 AM   #2
rayfordj
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 488

Rep: Reputation: 78
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
 
Old 11-25-2008, 08:47 PM   #3
salter
Member
 
Registered: Oct 2008
Posts: 100

Rep: Reputation: 15
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.

Last edited by Tinkster; 10-30-2010 at 05:11 PM.
 
Old 11-25-2008, 09:19 PM   #4
Telemachos
Member
 
Registered: May 2007
Distribution: Debian
Posts: 754

Rep: Reputation: 59
Quote:
Originally Posted by rayfordj View Post
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.
 
Old 11-25-2008, 10:52 PM   #5
nirmit
Member
 
Registered: Feb 2008
Posts: 73

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by rayfordj View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
setting backtrack in command line milovedo Linux - General 1 11-04-2008 02:07 AM
MySQL Can't connect to DB when passing passwd on command line dimsh Linux - Software 2 11-08-2005 02:38 AM
setting the time in command line DJOtaku Linux - General 11 04-15-2005 11:41 AM
Setting Resolution from command line Teoryn Mandriva 5 01-23-2004 03:55 PM
Setting resolution from command line Teoryn Linux - General 1 01-23-2004 02:56 PM


All times are GMT -5. The time now is 06:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration