![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| need script for passwd , can't use expect tool | Nicol | Shell Programming and Scripting | 35 | 07-20-2009 11:00 PM |
| invoking script from /etc/passwd | seeker333 | Shell Programming and Scripting | 3 | 04-25-2008 12:53 PM |
| script to update gecos in passwd file | jyoung | Shell Programming and Scripting | 1 | 03-05-2008 02:45 PM |
| passwd in shell script | corny | Shell Programming and Scripting | 8 | 10-02-2006 11:44 PM |
| passwd -l script | antalexi | Shell Programming and Scripting | 3 | 02-23-2005 01:07 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
setting passwd in script
HP-UX 11
I currently have a script that is running useradd and passwd commands to automate setting up new users. It was originally designed so that passwd was run with -d -f to delete a passwd and force user to set passwd at next login. Now mgmt wants instead to set a first-time passwd and have the user change it at next login. Assuming the script "knows" (that is, has passed to it) what to use as a first-time passwd, how can I set it? useradd doesn't seem to have that option passwd only will do it interactively and I don't have *expect* to handle this - I thought maybe sam commands could do it - but now I can't find the man page for those to double check. Any ideas? Lisa |
|
|||||
|
You could obtain expect at The HP-UX Porting and Archive Centre. As for sam, it is interactive by nature. But it uses an undocumented feature. /usr/sam/lbin/useradd.sam is a symlink to useradd. userradd checks its name. If it's useradd.sam, a -p option becomes available. However the argument must be the encrypted password. It's hard to encrypt a password in a ksh script. But this might be an ioption if you have the encrypted string. Also I wrote a script that uses telnet to change passwords on multiple systems. That technique could be used to change a password on the localhost.
changepass automate password changes on multiple systems |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|