1823029 Members
3649 Online
109645 Solutions
New Discussion юеВ

Re: passwd

 
SOLVED
Go to solution
j773303
Super Advisor

passwd

When I issue the passwd command, it always ask me to enther the older password and issue new passwd. Is it passible issue the passwd command, the auto enther the password by script or other ways?
Hero
10 REPLIES 10
Steven E. Protter
Exalted Contributor

Re: passwd

root user is not asked for the old password.

log on as root.

passwd

You will not be prompted for the old password.

You MUST be superuser to do this.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
j773303
Super Advisor

Re: passwd

I use the normal user. And every month I need to chage the password again. Any other quick way to auto change password?
Hero
Steven E. Protter
Exalted Contributor

Re: passwd

No easy way.

passwd < input.file

input file includes the password twice.

This is completely insecure.

At least make sure you erase the input file when you are done.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Hari Kumar
Trusted Contributor

Re: passwd

Please refer to this thread, Here a great script by Rita

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=227228

I cant understand if u want to enter a passwd from script, y need of 'password' we can make it NULL or make it not force for password change.. or else i may not clear with your question,
Information is Wealth ; Knowledge is Power
Rajeev  Shukla
Honored Contributor

Re: passwd

The best way to do this is..
I have written an C program which encrypts the password (with the random first 2 fields).
You then use /usr/sam/lbin/usermod.sam command with -p option and source this password.
Totally secure..

Cheers
Rajeev
j773303
Super Advisor

Re: passwd

Can you make an example how to use usermod.sam if I want to change user1 password? Thanks.
Hero
Rajeev  Shukla
Honored Contributor
Solution

Re: passwd

First is to get the encrypted password.
say encrypted password for "test123" is iR1PEHS6Mybdg
Then just type
/usr/sam/lbin/usermod -p iR1PEHS6Mybdg
That will change the password of the user to test123.
I had posted that C program in one post but let me know if you want it.

Rajeev
j773303
Super Advisor

Re: passwd

I can use usermod.sam to change the user1 password in the root user mode. But the permission deny in the user1 mode? why usermode.sam can not executed in the normal user?
Hero
Darren Prior
Honored Contributor

Re: passwd

This is because usermod.sam is a backend program for sam. It's not intended for use by normal users.

regards,

Darren.
Calm down. It's only ones and zeros...
Mr MORVAN
New Member

Re: passwd

Hello,

Can i have our C program please ?