1

Can you advise over it..this was question for me to check but was not able to get this ...if the group can help.. can you advise.. my question is clear that we should not be root or root user to do that

Deepesh
  • 11
  • 2

2 Answers2

2

The passwd utility has the setuid bit set. It means that it will be run as root.

$ ls -lh /usr/bin/passwd 
-rwsr-xr-x 1 root root 53K May 17 01:37 /usr/bin/passwd

So this utility will be able to modify the /etc/shadow and /etc/passwd files, which are owned by root.

As it is written in the man page,

A normal user may only change the password for his/her own account

Programs using the setuid bit should be really carefully designed, since running as root is a real security risk.

pim
  • 802
1

Yes. Any user can run passwd to change their own password.

uSlackr
  • 9,053