Sponsored Content
Top Forums Shell Programming and Scripting Script to change UNIX password Post 20160 by hugo_perez on Monday 22nd of April 2002 02:57:48 PM
Old 04-22-2002
The others commands are AIX commands (supper in SP2 environments) and a GNU tool, both for distribute files.

Whith rdist, you can distribute the following files:

/etc/passwd
/etc/groups
/etc/shadow

and if you use solaris 8

/etc/user_attr.



---------------------------------------

If only want to change one password, use "expect"
http://www.sunfreeware.com

ask the administrator to install expect and tcl.
(and give you acces to expect /usr/local/bin )

tcl
and
expect

(tcl is a pre-requisite of expect pakage).

Note: You need to create a expect file and call expect -f my_expect1

Example of my_expect1

spawn telnet [lindex $argv 0]
expect "login: "
send "[lindex $argv 1]\r"
expect "Password: "
send "[lindex $argv 2]\r"
expect "Sun Microsystems Inc. SunOS 5.8 Generic February 2000"
send "passwd\r"
expect "Enter login password: "
send "[lindex $argv 2]\r"
expect "New password: "
send "[lindex $argv 3]\r"
expect "e-enter new password: "
send "[lindex $argv 3]\r"
expect eof

Note: To call

expect -f my_expect1 <server> <user_name> <old_passwd> <new_passwd>

also you need to make a script to cal the previous line giving the apropiate parameters.

IMPORTANT: Is convenient that anybody was login into the server,
because with a ps he can view your passwd.


Regards. Hugo.

Last edited by hugo_perez; 04-22-2002 at 04:30 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Change password script in Unix easily..

I have more than 50 server unix's password need to change, usually I assign one password for all hosts, for easy remember, but I need to change password every two months..it's very tried to change password every 2 months, is there any unix script that can change password easily? ie ' script... (4 Replies)
Discussion started by: zp523444
4 Replies

2. Shell Programming and Scripting

script/program to change the password ?

hi, Somebody have or known where i can find a perl small perl program to change the password. The point: First it verify is the user exist, checking the old typed password and replace it with new. The passwords must be encoded. Thanks, very much! (0 Replies)
Discussion started by: kad
0 Replies

3. 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

4. UNIX for Dummies Questions & Answers

Where to change the UNIX password prompt?

Hi guys, I got these 3 servers: a, b and c which I ssh from a to b/c. a:$ ssh userid@b Password: a:$ ssh userid@c userid@c's password: Notice that the password prompt is different (highlighted in bold) on both servers even though their SUN Solaris version the same, OpenSSH version... (0 Replies)
Discussion started by: DrivesMeCrazy
0 Replies

5. Shell Programming and Scripting

Unix script to change password

Hello Gurus I have little challenge which I do not know how to address it. I have unix account on many servers (let's say over 25). These accounts expire every 60 days. Is there scripts that I can run from my "local computer" and pass a new password to it where it would change it for me on all... (7 Replies)
Discussion started by: nimo
7 Replies

6. HP-UX

Automatic script to change the UNIX Password

Hi, we have around 50 users and every month we need to change the password manually once its expire. do we have any script to change the password automatically. OS -HP-UX Thanks in advance.. (6 Replies)
Discussion started by: periyasamycse
6 Replies

7. Shell Programming and Scripting

Script to change password in UNIX

Hi Friends, Every morning i need to change the password, please advise how it can be automated. I am having pre planned password list for 4 months which can be used as input file for new passwords. Thanks (28 Replies)
Discussion started by: rajjev_saini123
28 Replies

8. Shell Programming and Scripting

A script to change password for all other servers

Hey Gurus, I have this requirement to change the password for other servers remotely from one server. So, I installed public keys on all servers and wrote the following script to do the job. Something appears to be wrong with my loop, as it only changes one server and ignores the rest. I'm... (24 Replies)
Discussion started by: Hiroshi
24 Replies

9. Shell Programming and Scripting

Shell script to change the password

Hi Folks, I am trying to change the password for the user "sysservice" Where my requirement is login to each server and exit from that and ssh to the next server.. I have enabled the password less auth for the user sysservice. for i in `cat /home/sysservice/servers.txt` do ssh... (1 Reply)
Discussion started by: gsiva
1 Replies

10. 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
BB-SERVICES(5)							File Formats Manual						    BB-SERVICES(5)

NAME
bb-services - Configuration of TCP network services SYNOPSIS
$BBHOME/etc/bb-services DESCRIPTION
bb-services contains definitions of how bbtest-net(1) should test a TCP-based network service (i.e. all common network services except HTTP and DNS). For each service, a simple dialogue can be defined to check that the service is functioning normally, and optional flags deter- mine if the service has e.g. a banner or requires SSL- or telnet-style handshaking to be tested. FILE FORMAT
bb-services is a text file. A simple service definition for the SMTP service would be this: [smtp] send "mail quit " expect "220" options banner This defines a service called "smtp". When the connection is first established, bbtest-net will send the string "mail quit " to the service. It will then expect a response beginning with "220". Any data returned by the service (a so-called "banner") will be recorded and included in the status message. The full set of commands available for the bb-services file are: [NAME] Define the name of the TCP service, which will also be the column-name in the resulting display on the test status. If multiple tests share a common definition (e.g. ssh, ssh1 and ssh2 are tested identically), you may list these in a single "[ssh|ssh1|ssh2]" definition, separating each service-name with a pipe-sign. send STRING expect STRING Defines the strings to send to the service after a connection is established, and the response that is expected. Either of these may be omitted, in which case bbtest-net(1) will simply not send any data, or match a response against anything. The send- and expect-strings use standard escaping for non-printable characters. " " represents a carriage-return (ASCII 13), " " represents a line-feed (ASCII 10), " " represents a TAB (ASCII 8). Binary data is input as "xNN" with NN being the hexadecimal value of the byte. port NUMBER Define the default TCP port-number for this service. If no portnumber is defined, bbtest-net(1) will attempt to lookup the portnum- ber in the standard /etc/services file. options option1[,option2][,option3] Defines test options. The possible options are banner - include received data in the status message ssl - service uses SSL so perform an SSL handshake telnet - service is telnet, so exchange telnet options FILES
$BBHOME/etc/bb-services SEE ALSO
bbtest-net(1) Xymon Version 4.2.3: 4 Feb 2009 BB-SERVICES(5)
All times are GMT -4. The time now is 11:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy