Sponsored Content
Top Forums Shell Programming and Scripting Can someone please show me a very simple "expect" script to change password in Solaris please? Post 302992403 by RudiC on Friday 24th of February 2017 12:41:07 PM
Old 02-24-2017
Look at the links at the bottom left of this page under the "More UNIX and Linux Forum Topics You Might Find Helpful" header.
This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Solaris

Solaris escape my script from "-" to "/226"

Hello everyone. I beg your guys pardon please. I try to ls -al in many path/directories. So, I put the code in text file which look like below; ls -al / ls -al /etc ls -al /etc/default ... however, when I paste it to Solaris over SecureCRT, it seems the code was escaped from "-" to... (0 Replies)
Discussion started by: Smith
0 Replies

2. Shell Programming and Scripting

show dots when script is "thinking"

Hey, I'm running the following script: #!/bin/bash kjv=kjv.txt trim(){ local trim_string local _TRIM=$1 trim_string=${_TRIM##*} _TRIM=${_TRIM#"trim_string"} echo $_TRIM } #trim() { # echo $( _trim "$@" ) #} printf "How many chapters? " read response (10 Replies)
Discussion started by: pkohn11
10 Replies

3. UNIX for Advanced & Expert Users

Customize "change password" in unix shell

I want to customize the "change password" through unix shell. when a user's password is expired and he/she logs into shell next time he/she will be asked to change his/her password. At this time when the user provides new password instead of unix doing the "password change" action I want to call my... (4 Replies)
Discussion started by: sharmanikhilesh
4 Replies

4. Shell Programming and Scripting

exec perl in expect script yields "invalid command"

I'm trying to execute something like this: exec perl -i -pe 's/\015/\012/g' '${file}' in my expect script and I get: error "invalid command name \"perl\". however, if I run perl -i -pe 's/\015/\012/g' "/Users/Shared/menu-items.txt" directly in my terminal, it runs fine. I'm an... (4 Replies)
Discussion started by: dpouliot
4 Replies

5. Shell Programming and Scripting

Passing username and password to a script running inside "expect" script

Hi I'm trying to run a script " abc.sh" which triggers "use.sh" . abc.sh is nothing but a "expect" script which provides username and password automatically to the use.sh script. Please find below the scripts: #abc.sh #!/usr/bin/expect -f exec /root/use.sh expect "*name*" send... (1 Reply)
Discussion started by: baddykam
1 Replies

6. Shell Programming and Scripting

Find lines with "A" then change "E" to "X" same line

I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
Discussion started by: nightwatchrenba
10 Replies

7. AIX

How to use 'expect' to pass UID & Password to a "for loop" in shell script?

Friends, Need someone's help in helping me with the below requirement for a script: > For a list of servers(over 100+), I need to login into each of them(cannot configure password-less ssh) & grab few configuration details < I know, this is possible through expect programming in a simple... (2 Replies)
Discussion started by: thisissouvik
2 Replies

8. Shell Programming and Scripting

How to use 'expect' to pass UID & Password to a "for loop" in shell script?

Friends, Need someone's help in helping me with the below requirement for a script: > For a list of servers(over 100+), I need to login into each of them(cannot configure password-less ssh) & grab few configuration details < I know, this is possible through expect programming in a simple... (14 Replies)
Discussion started by: thisissouvik
14 Replies

9. Shell Programming and Scripting

Expect: spawn id exp5 not open while executing "expect "$" { send "sudo su -\r" }"

Hi All, i am trying to ssh to a remote machine and execute certain command to remote machine through script. i am able to ssh but after its getting hung at the promt and after pressing ctrl +d i am gettin the out put as expect: spawn id exp5 not open while executing "expect "$" {... (3 Replies)
Discussion started by: Siddharth shivh
3 Replies

10. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
RPC.YPPASSWDD(8)					       NIS Reference Manual						  RPC.YPPASSWDD(8)

NAME
rpc.yppasswdd - NIS password update daemon SYNOPSIS
rpc.yppasswdd [-D directory] -e chsh|chfn [--port number] [-f|--foreground] rpc.yppasswdd [-s shadow] [-p passwd] -e chsh|chfn [--port number] [-f|--foreground] rpc.yppasswdd -x program | -E program -e chsh|chfn [--port number] [-f|--foreground] DESCRIPTION
rpc.yppasswdd is the RPC server that lets users change their passwords in the presence of NIS (a.k.a. YP). It must be run on the NIS master server for that NIS domain. When a yppasswd(1) client contacts the server, it sends the old user password along with the new one. rpc.yppasswdd will search the system's passwd file for the specified user name, verify that the given (old) password matches, and update the entry. If the user specified does not exist, or if the password, UID or GID doesn't match the information in the password file, the update request is rejected, and an error returned to the client. If this version of the server is compiled with the CHECKROOT=1 option, the password given is also checked against the systems root password. After updating the passwd file and returning a success notification to the client, rpc.yppasswdd executes the pwupdate script that updates the NIS server's passwd.* and shadow.byname maps. This script assumes all NIS maps are kept in directories named /var/yp/nisdomain that each contain a Makefile customized for that NIS domain. If no such Makefile is found, the scripts uses the generic one in /var/yp. It is possible to pass OPTIONS to rpc.yppasswdd using the environment variable YPPASSWDD_ARGS and this variable can be set in /etc/sysconfig/yppasswdd. OPTIONS
The following options are available: -D directory The passwd and shadow files are located under the specified directory path. rpc.yppasswdd will use this files, not /etc/passwd and /etc/shadow. This is useful if you do not want to give all users in the NIS database automatic access to your NIS server. -E program Instead of rpc.yppasswdd editing the passwd & shadow files, the specified program will be run to do the editing. The following environment variables will be set for the program: YP_PASSWD_OLD, YP_PASSWD_NEW, YP_USER, YP_GECOS, YP_SHELL. The program should return an exit status of 0 if the change completes successfully, 1 if the change completes successfully but pwupdate should not be run, and otherwise if the change fails. -p passwdfile This options tells rpc.yppasswdd to use a different source file instead of /etc/passwd This is useful if you do not want to give all users in the NIS database automatic access to your NIS server. -s shadowfile This options tells rpc.yppasswdd to use a different source file instead of /etc/passwd. See below for a brief discussion of shadow support. -e [chsh|chfn] By default, rpc.yppasswdd will not allow users to change the shell or GECOS field of their passwd entry. Using the -e option, you can enable either of these. Note that when enabling support for ypchsh(1), you have to list all shells users are allowed to select in /etc/shells. -x program When the -x option is used, rpc.yppasswdd will not attempt to modify any files itself, but will instead run the specified program, passing to its stdin information about the requested operation(s). There is a defined protocol used to communicate with this external program, which has total freedom in how it propagates the change request. See below for more details on this. -m Will be ignored, for compatibility with Solaris only. --port number rpc.yppasswdd will try to register itself to this port. This makes it possible to have a router filter packets to the NIS ports. -v --version Prints the version number and if this package is compiled with the CHECKROOT option. -f, --foreground will not put itself into background. MISCELLANEOUS
Shadow Passwords Using Shadow passwords alongside NIS does not make too much sense, because the supposedly inaccesible passwords now become readable through a simple invocation of ypcat(1). Shadow support in rpc.yppasswdd does not mean that it offers a very clever solution to this problem, it simply means that it can read and write password entries in the system's shadow file. You have to produce a shadow.byname NIS map to distribute password information to your NIS clients. rpc.yppasswdd will search at first in the /etc/passwd file for the user and password. If it find's the user, but the password is "x" and a /etc/shadow file exists, it will update the password in the shadow map. Use of the -x option The program should expect to read a single line from stdin, which is formatted as follows: <username> o:<oldpass> p:<password> s:<shell> g:<gcos> where any of the three fields [p, s, g] may or may not be present. This program should write "OK " to stdout if the operation succeeded. On any other result, rpc.yppasswdd will report failure to the client. Note that the program specified by the -x option is responsible for doing any NIS make and build, and for doing any necessary validation on the shell and gcos field information supplied. The password passed to the client will be in UNIX crypt() format. Logging rpc.yppasswdd logs all password update requests to syslogd(8)'s auth facility. The logging information includes the originating host's IP address and the user name and UID contained in the request. The user-supplied password itself is not logged. Security rpc.yppasswdd should be as secure or insecure as any program relying on simple password authentication. If you feel that this is not enough, you may want to protect rpc.yppasswdd from outside access by using the `securenets' feature of the new portmap(8) version 3. Better still, look at rpasswdd(8). FILES
/usr/sbin/rpc.yppasswdd /usr/lib/yp/pwupdate /etc/passwd /etc/shadow /etc/sysconfig/yppasswdd SEE ALSO
passwd(5), shadow(5), passwd(1), rpasswdd(8), yppasswd(1), ypchsh(1), ypchfn(1), ypserv(8), ypcat(1) AUTHOR
Olaf Kirch <okir@monad.swb.de> and Thorsten Kukuk <kukuk@linux-nis.org> NIS Reference Manual 09/26/2007 RPC.YPPASSWDD(8)
All times are GMT -4. The time now is 11:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy