Solved

passwd

Posted on 2000-03-06
8
551 Views
Last Modified: 2010-04-21
I have been working with tcl and expect trying to get an html page to change a users name and password for them.

Either I did something or the expect program did something.

Now when I log on to the Unix box and type passwd I get the following response:

passwd: Changing password for 'username'
Permission denied

However, when I log on as root it still works.

Can anyone help me?
0
Comment
Question by:afpcos
8 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 2588984
Try executing passwd with the absolute path, e.g., /bin/passwd. I'll bet your expect script is named passwd and it's being found before the system copy (like when "." is in your path ahead of everything else).
0
 
LVL 2

Author Comment

by:afpcos
ID: 2589122
jlevie...

I get the same response from the system when I enter /bin/passwd.
0
 
LVL 40

Accepted Solution

by:
jlevie earned 100 total points
ID: 2589490
Rats, it's not going to be nice & easy...

What Unix are you using? The ones I have direct access to (Solaris, Linux & Irix) all show passwd to be owned by root and suid to root. Perhaps the ownership/mode of the passwd executable has changed. Also possible is that your passwd isn't actually in /bin and you're not executing the actual passwd executable. What did you name your expect script? If you do "file /bin/passwd" what does it say?

0
 
LVL 3

Expert Comment

by:freesource
ID: 2590284
I wouldn't be too surprised if the permissions are wrong on the actual passwd file, check that, too.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 3

Expert Comment

by:freesource
ID: 2590293
for the above .. i.e. not the executable, but where the passwords are written.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2590343
Re: freesource's comment... Good point, we don't yet know which Unix it is and how it would behave if the perms on /etc/passwd [and maybe shadow] weren't right. /etc/password typically is owned by root and mode rw-r--r--, shadow r--------. I know that Solaris, Linux & Irix don't appear to care ('cause I just tried with the perms wrong), but...
0
 
LVL 15

Expert Comment

by:samri
ID: 2590813
afpcos,

Just wandering: are you trying to change you own password or sombody else password?  Only root (or root equivalent) are allowed to change other users password.

And from the browser, the script is running under what userid.  Normally, the CGI scripts will be executed under the WEB server UID (which is normally nobody).  If this is the case, try to get your scripts to be suid root, and check your web server configuration on how this could be achieved.

good luck,

samri
0
 

Expert Comment

by:cartoon022100
ID: 2592198
Hi,
from root try editing your /etc/passwd file to remove the encrypted password
after writing try to logon.May work :-)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now