LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 11-03-2003, 01:13 AM   #1
kamal_aitin
LQ Newbie
 
Registered: Aug 2003
Location: Pune,India
Distribution: Redhat 9
Posts: 5

Rep: Reputation: 0
Shell script to change password


Hi...
I want to write a shell script to change my password and I want that password to be picked up from a file and I'm not supposed to type anything once I run that script and change the password.Is it possible...if yes please send me the solution.

Thanks in advance,
Regards,
kamal.
 
Old 11-03-2003, 01:40 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,974
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
man chpasswd
But it's not really a good idea :)

Cheers,
Tink
 
Old 05-22-2006, 07:01 AM   #3
satya_nit
LQ Newbie
 
Registered: May 2006
Posts: 1

Rep: Reputation: 0
Hi Gurus ,

I am a new member to this group and also a novice user for unix . I have to write a shell script which can change the password of a userid four times. I want that it should read the first 3 passwords from a file . The fourth time the password will be the one which was in the beginning .

Kindly help me .

Regards,
Satya
 
Old 07-24-2007, 04:39 PM   #4
des_a
Member
 
Registered: Sep 2006
Posts: 301

Rep: Reputation: 18
Looks like I'll need a script to do this same thing, as well, I'm seeing. I found one thing that doesn't work.

Code:
passwd < [file name]
I'm trying to do this for another similar reason as you guys. I'll check out that man page too. It might work for me.
 
Old 07-24-2007, 07:24 PM   #5
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 59
Sounds like this exercise may be part of the curriculum of some similar course the three of you are taking when considering the quote below.
Quote:
I have to write a shell script
 
Old 07-25-2007, 12:09 AM   #6
des_a
Member
 
Registered: Sep 2006
Posts: 301

Rep: Reputation: 18
And now, I've found what does work for me, in my limited case of what I needed. If this solution works for you too, then here it is:

Code:
echo [passwd] > /tmp/[password file]
passwd --stdin [user] < [file with password]
 
Old 07-25-2007, 12:09 AM   #7
des_a
Member
 
Registered: Sep 2006
Posts: 301

Rep: Reputation: 18
When I found this, by the way, it was after looking up chpassword, and I couldn't make it work for me, for some reason.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change batch script to shell script alan.belizario Programming 5 03-31-2005 12:41 AM
Change batch script to shell script alan.belizario Linux - Software 1 03-30-2005 01:49 AM
Shell Script For Password cpope67 Programming 4 01-10-2005 02:16 AM
Password Shell Script Solaris 9 cpope67 Solaris / OpenSolaris 1 12-30-2004 03:15 PM
Restricted shell to change the password mussons Linux - Security 12 07-24-2003 10:05 PM


All times are GMT -5. The time now is 12:15 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration