LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-21-2009, 08:13 AM   #1
sinchan_
LQ Newbie
 
Registered: Apr 2009
Posts: 12

Rep: Reputation: 0
Avoid users to change password


Hi

I'm using opensuse and i'm trying that users cannot change his own password (mantaining /bin/bash users active). Do you know how can I do it?

Thanks in advance
 
Old 10-21-2009, 08:17 AM   #2
Tux-Slack
Member
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware 13.37
Posts: 511

Rep: Reputation: 37
Try here:
http://www.linuxquestions.org/questi...ccount-218616/
 
Old 10-21-2009, 08:23 AM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
If you want all your user not to be able to change their password, remove the suid bit from /usr/bin/passwd

Regards
 
Old 10-21-2009, 08:40 AM   #4
sinchan_
LQ Newbie
 
Registered: Apr 2009
Posts: 12

Original Poster
Rep: Reputation: 0
Thanks for the answers.

I thought to remove the suid, but i readed this in one forum (and i have not very expertise in linux yet):

Use of the SUID bit on binaries (to run with root privileges, aka ”setuid bit”) MUST be limited to those shown in the following list:

/bin/ping
/bin/su
/usr/bin/at
/usr/bin/chage
/usr/bin/chfn
/usr/bin/chsh
/usr/bin/crontab
/usr/bin/gpasswd
/usr/bin/newgrp
/usr/bin/passwd

Is the passwd -n option safer? I think that this 2 options will not change the normal users to other services like subversion, can you please confirm it.
 
Old 10-21-2009, 08:51 AM   #5
Tux-Slack
Member
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware 13.37
Posts: 511

Rep: Reputation: 37
passwd -n option will set you some amount of days, before a user will be able to change his password. If you set to 365, he wont be able to change his password for a year.
If you remove the suid flag from passwd then passwd wont work anymore for any non-root user, but you, as root will still be able to use it.
 
Old 10-21-2009, 08:55 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
You need the suid bit for passwd in order for the users to be able to change their password, which is the default.
If you for any reason want to deny this feature for all your users, you can safely remove the suid bit.
Else you have to manually enter the expiration day for all of them.
I don't see any reason why prohibiting password change should have any impact on the services you've mentioned.

Regards
 
Old 10-21-2009, 08:56 AM   #7
sinchan_
LQ Newbie
 
Registered: Apr 2009
Posts: 12

Original Poster
Rep: Reputation: 0
Then remove the suid seems to be the best option.

Last question, and sorry about my lack of knowledge, command to be used should be chmod -s /usr/bin/passwd ?

best regards

edit: Yes, change the timelimit for all users will be very annoying. It's good to know it to apply this for one or two users. ty

Last edited by sinchan_; 10-21-2009 at 09:01 AM. Reason: add comment
 
Old 10-21-2009, 08:59 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Yes, chmod -s should do the job

Cheers
 
Old 10-21-2009, 09:45 AM   #9
sinchan_
LQ Newbie
 
Registered: Apr 2009
Posts: 12

Original Poster
Rep: Reputation: 0
I used the chmod -s but it didnt worked :S

Finally I found a solution that worked, set permissions as 754 (removing X from others)

cheers
 
Old 10-21-2009, 11:31 AM   #10
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
What you mean by "it didn't work". Just tested on an openSUSE 10.3 box and it doesn't allow the user to change his password. In fact it gives "Authentication failure" when user enters the old password in order to change it.
 
Old 10-21-2009, 02:48 PM   #11
sinchan_
LQ Newbie
 
Registered: Apr 2009
Posts: 12

Original Poster
Rep: Reputation: 0
i found the error. My user was on root group :S
removing it from root group also resolved the problem

Thanks 4 help
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help in LDAP; Users can change their password ashwintumma Linux - Software 1 08-22-2009 10:24 AM
RHEL5 Users cannot change password, but root can ggiwtc Linux - Server 2 12-10-2008 02:56 PM
How change password for kerberos users using passwd comand sarajevo Linux - Security 0 10-23-2007 04:48 AM
Best way for users to change/recover password psychobyte Linux - Networking 1 01-18-2006 12:58 AM
How to make Samba users change password on first use eflester Linux - Security 0 10-12-2004 06:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration