Solved

passwd

Posted on 2000-03-06
8
583 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

617 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