Sponsored Content
Top Forums Shell Programming and Scripting Why passwd isnt working in shell scripts? Post 34039 by Perderabo on Friday 31st of January 2003 09:46:36 AM
Old 01-31-2003
passwd opens /dev/tty for reading. And it will read /dev/tty to obtain a password. Before it reads the terminal, it reconfigures it to turn off echo, so that the password cannot be seen as it is typed. If that reconfiguration fails, passwd will give up. And after it has the password, it turns echo back on. Operations like these simply require a terminal.

If that behavior is acceptable, then the passwd command does indeed work in scripts just fine. The "problem" is that people want the script to be able to supply the password rather than the user of the script. In that case, you need expect.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

passwd command not working

Hello All, I am working on Sco unix version 5.0.5. The passwd command has somehow got corrupted and is only displaying the contents of the /etc/passwd file instead of changing the password. I wanted to know if there is any other command through which you can change the password of a user from... (5 Replies)
Discussion started by: rahulrathod
5 Replies

2. Shell Programming and Scripting

Move command in the shell isnt executing...

-----------------------------------------------------------------------------Pls find my Q in the bottom--------------------------------------------- #!/bin/ksh #+---------------------------------------------- #| #| Usage: . scripts/run_all.ksh < scripts/run_all.txt #| #| This script... (2 Replies)
Discussion started by: thumsup9
2 Replies

3. Shell Programming and Scripting

Scripts for IDīs free in /etc/passwd

As extracting of the file /etc/passwd the IDīs that have not been used in a range specifies. (2 Replies)
Discussion started by: oscar_acm
2 Replies

4. UNIX for Dummies Questions & Answers

editing sqlplus id@passwd in multiple scripts, users and directories

hi all, i was given by my supervisor a task to search for scripts which contain oracle sqlplus i.e "myusername/mypasswd @myDB" in every /home/userfolder, which are, all the scripts made by different user. I've done some find command to search string for sqlplus, but it may up too long to respond.... (8 Replies)
Discussion started by: Helmi
8 Replies

5. Shell Programming and Scripting

why isnt cron working?

I am using Ubuntu linux desktop, and I am trying to schedule a sheel script to run every 10minutes. These are the steps I have taken: crontab -e added and saved this line to the file # m h dom mon dow command */1 * * * * /home/enzo/Desktop/dlrecentuse restarted cron: sudo... (5 Replies)
Discussion started by: daydreamer
5 Replies

6. UNIX for Dummies Questions & Answers

Passwd command not working

on Runnning passwd command on HPUX 11.23 I am getting pam_chauthtok: Shared object load failure. Pls help ... (1 Reply)
Discussion started by: ultimatix
1 Replies

7. Red Hat

how passwd cmd is working

how unix users able to change their password even if they have only read permissions and how backend process will be happening can u explain me which are files need to involved in this process (3 Replies)
Discussion started by: ponmuthu
3 Replies

8. Solaris

[Solved] passwd command not working

Hi all, I have got a problem, i have Solaris 8 server, where on running the passwd command, it says permission denied. I have checked /bin/passwd, /etc/passwd, /etc/shadow all have permissions as like one working server. It is happening for root user and all other users. i have tried... (6 Replies)
Discussion started by: varunksharma87
6 Replies

9. Shell Programming and Scripting

Code to remove files when corresponding file doesnt exist isnt working.

I am trying to add some code to the begging of a script so that it will remove all the .transcript files, when their is no coressponding .wav file. But it doesnt work. This is the code I have added: for transcriptfile in `$voicemaildir/*.transcript`; do wavfile=`echo $transcriptfile | cut -d'.'... (2 Replies)
Discussion started by: ghurty
2 Replies

10. Shell Programming and Scripting

Grep -w ip address from a file isnt working need help

I have a file "file1" that contains several ip address , and the "file2" contains several records , each line in file2 contains somewhere the ip address that i am searching in the file1 I use the unix command grep -w for i in `cat file1` do grep -w "$i" file2 >> file3 done ... (9 Replies)
Discussion started by: knijjar
9 Replies
PASSWD(1)						    BSD General Commands Manual 						 PASSWD(1)

NAME
passwd -- modify a user's password SYNOPSIS
passwd [-i infosystem] [-l location] [name] DESCRIPTION
Passwd changes the user's password. First, the user is prompted for their current password. If the current password is correctly typed, a new password is requested. The new password must be entered twice to avoid typing errors. The new password should be at least six characters long and not purely alphabetic. Its total length should be less than _PASSWORD_LEN (cur- rently 128 characters) although some infosystems allow longer passwords. Numbers, upper case letters and meta characters are encouraged. Once the password has been verified, passwd communicates the new password information to the authenticating host. -i infosystem This option specifies where the password update should be applied. Under Mac OS X 10.3, supported infosystems are: netinfo (default) The netinfo database containing the user's password. If no -l option is specified, the local netinfo database is assumed. file The local flat-files (included for legacy configurations). nis A remote NIS server containing the user's password. opendirectory A system conforming to opendirectory APIs and supporting updates (including LDAP, netinfo, etc). -l location This option causes the password to be updated in the given location of the choosen infosystem. When changing only the local password, pwd_mkdb(8) is used to update the password databases. for netinfo, location may be a domain name or server/tag for file, location may be a file name (/etc/master.passwd is the default) for nis, location may be a NIS domainname for opendirectory, location may be a directory node name The super-user privilages are not required change a user's current password if only the local password is modified. FILES
/etc/master.passwd The user database /etc/passwd A Version 7 format password file /etc/passwd.XXXXXX Temporary copy of the password file SEE ALSO
chpass(1), login(1), passwd(5), pwd_mkdb(8), vipw(8,) nicl(1) Robert Morris and Ken Thompson, UNIX password security. HISTORY
A passwd command appeared in Version 6 AT&T UNIX. 4th Berkeley Distribution June 6, 1993 4th Berkeley Distribution
All times are GMT -4. The time now is 08:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy