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
Solved

passwd

Posted on 2000-03-06
8
567 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
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…
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.

809 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