Non-interactive password change?


 
Thread Tools Search this Thread
Operating Systems Solaris Non-interactive password change?
# 1  
Old 04-23-2008
Non-interactive password change?

Does anyone know how I can do a non-interactive password change in Solaris 8 and 10?

Using Sed to edit the passwd file, or Expect to automate the process has already been considered.... I'm looking for something more direct.

Your guidance is appreciated.

akbar
# 2  
Old 04-23-2008
Im guessing by "more direct", you mean "easier to implement".

The two methods you mentioned are pretty much the options available to you (which option you use depends on whether you want to use the encrypted or unencrypted password string).

Writing an expect script to reset a password is simple, just do a google search and you will have several working examples within minutes.

Using expect to run the "passwd" command protects the integrity of the file as it uses file locking to edit it, and a typo in your script is less likely to corrupt the shadow file.

Also if you are going to be changing passwords via a script keep in mind that it is bad security to leave passwords lying around hardcoded in scripts.
# 3  
Old 04-28-2008
Quote:
Originally Posted by squall
Im guessing by "more direct", you mean "easier to implement".

The two methods you mentioned are pretty much the options available to you (which option you use depends on whether you want to use the encrypted or unencrypted password string).

Writing an expect script to reset a password is simple, just do a google search and you will have several working examples within minutes.

Using expect to run the "passwd" command protects the integrity of the file as it uses file locking to edit it, and a typo in your script is less likely to corrupt the shadow file.

Also if you are going to be changing passwords via a script keep in mind that it is bad security to leave passwords lying around hardcoded in scripts.
Thanks for your reply, Squall. I'lve decided to proceed using expect after all.

best regards
akbar
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Forum Support Area for Unregistered Users & Account Problems

Password sent via reset password email is 'weak' and won't allow me to change my password

I was unable to login and so used the "Forgotten Password' process. I was sent a NEWLY-PROVIDED password and a link through which my password could be changed. The NEWLY-PROVIDED password allowed me to login. Following the provided link I attempted to update my password to one of my own... (1 Reply)
Discussion started by: Rich Marton
1 Replies

2. UNIX for Dummies Questions & Answers

SFTP in non-interactive mode without password

Hello all, can we SFTP to the destination server in a non-interactive mode with out estbalishing the public key of origination server in the destination server? meaning i want to harcode the password as part of the below script or as an variable? Please let me know if there is any better way to... (2 Replies)
Discussion started by: Ariean
2 Replies

3. Red Hat

Password less SSH for non-interactive NUID

We have a script which rsyncs two directories on two servers. This rsync will happen with the ID svID. But the script runs with the Control-M ID opID. we have setup password less SSH for svID, but it fails with Host key verification failed when the script is executed by opID. As opID is a... (1 Reply)
Discussion started by: Madimi
1 Replies

4. AIX

Change password to blank password

AIX 6.1 User has a password set. It needs to be a blank password (no password). smit passwd enter user name at change password and confirm password, just press ENTER Afterwards, I could not log on with blank password or with original password. How can I change the password to a... (2 Replies)
Discussion started by: landog
2 Replies

5. UNIX for Advanced & Expert Users

Automating Interactive password change

I have written the below scripts . ldap_pwd_prompt.ksh #!/usr/bin/ksh passwd -r ldap interactive_pwd_change.exp #!/usr/local/bin/expect set timeout 10 set curpass set newpass spawn ./ldap_pwd_prompt.ksh expect "Enter existing login password:" send "$curpass\r" expect "New... (6 Replies)
Discussion started by: dr46014
6 Replies

6. Homework & Coursework Questions

How to write script that behaves both in interactive and non interactive mode

Q. Write a script that behaves both in interactive and non interactive mode. When no arguments are supplied it picks up each C program from the directory and prints first 10 lines. It then prompts for deletion of the file. If user supplies arguments with the script , then it works on those files... (8 Replies)
Discussion started by: rits
8 Replies

7. Solaris

Solaris 8 - Asks for current root password when trying to change root password.

Hello All, I have several solaris boxes running Solaris 8. When changing root passwords on them, all will simply ask for the new root password to change and of course to re-type the new password. One of the systems however asks for the existing root password before it will display the new password... (8 Replies)
Discussion started by: tferrazz
8 Replies

8. Shell Programming and Scripting

how to change root password using shell script with standard password

Hi Friends. I am new to scripting now i want to change the root password using the script with standard password. which is the easy scripting to learn for the beginner, Thanks in advance. (2 Replies)
Discussion started by: kurva
2 Replies

9. Shell Programming and Scripting

ERROR : Permission denied (publickey,password,keyboard-interactive).

Hello, when I try to connect to a remote machine through SSH username@host I am getting the error message Permission denied (publickey,password,keyboard-interactive). Can any one tell me what is the problem. the key is added in the remote machines authorized_keys file. (5 Replies)
Discussion started by: deepusunil
5 Replies

10. UNIX for Dummies Questions & Answers

Change password by pushing encrypted password to systems

I'm tasked to change a user's password on multiple Linux systems (RH v3). I though copying the encrypted password from one Linux /etc/shadow file to another would work but I was wrong. The long term solution is to establish an openLDAP Directory service, but for now I'm stuck with a manual... (1 Reply)
Discussion started by: benq70
1 Replies
Login or Register to Ask a Question