LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-07-2012, 01:33 AM   #1
mahesh manakawad
LQ Newbie
 
Registered: May 2012
Posts: 11

Rep: Reputation: Disabled
Default visiblepw in sudoers confirmation


Hello everyone,

I have some questions because I need to work on Linux password management.

1. I want only admin can change other users password.
2. With sudo command I can change other user password.
3. What is the use of adding User ALL=(ALL:ALL) ALL in sudoers file.
4. What is use of Default visiblepw in sudoers file.

Please any one can help me to clarify above questions

Thank you
 
Old 06-07-2012, 02:43 AM   #2
Slackyman
Member
 
Registered: Mar 2011
Location: Rome - Italy
Distribution: Slackware 13.1
Posts: 347

Rep: Reputation: 44
1 - With sudo passwd -n <MIN> <username> you can lock the <username> password for <MIN> days (<username> is the login-name of the user). To be sure users cannot change password you can use sudo passwd -n 10 -x 1 <username> since if tha minimum (-n) is greater than the maximum (-x) the user cannot change the password.
2 - you can do it with sudo passwd <username> (<username> is the login-name of the user)
3 - adding that line you allws User to use duso and run all commands.
4 - visiblepw is set OFF by default. Read this about visiblepw

Last edited by Slackyman; 06-07-2012 at 03:40 PM.
 
Old 06-07-2012, 03:03 AM   #3
mahesh manakawad
LQ Newbie
 
Registered: May 2012
Posts: 11

Original Poster
Rep: Reputation: Disabled
Hi Slackyman,

Thanks for your quick reply

I wanted to clarify how can I make only admin can change other user password.
Because I'm getting "no TTY present" error when I wanted to change other user password.
Please help me to solve this

Thank you again
 
Old 06-07-2012, 03:44 PM   #4
Slackyman
Member
 
Registered: Mar 2011
Location: Rome - Italy
Distribution: Slackware 13.1
Posts: 347

Rep: Reputation: 44
Which distro are you running?
"Defaults visiblepw" in sudoers file enables sudo even if a console doesn't allocate a tty.
Change your file with visudo by adding Defaults visiblepw and you can use sudo.
 
Old 06-07-2012, 11:34 PM   #5
mahesh manakawad
LQ Newbie
 
Registered: May 2012
Posts: 11

Original Poster
Rep: Reputation: Disabled
Hello Slackyman,
Let me define mine application clearly

1. I have created one j2ee application using SSHXcute jar.
2. I wanted to manage password of remote system using that application.
3. I'm login in to remote system and I can reset self password also but when I'm trying to change other user password I'm getting
"no tty present " Error.
4. Can you tell me how to resolve it.

Please let me know where I'm wrong.

Thank you
 
Old 06-08-2012, 01:29 AM   #6
Slackyman
Member
 
Registered: Mar 2011
Location: Rome - Italy
Distribution: Slackware 13.1
Posts: 347

Rep: Reputation: 44
According to the sudo manual:
Quote:
By default, sudo will refuse to run if the user must enter a password but it is not possible to disable echo on the terminal. If the visiblepw flag is set, sudo will prompt for a password even when it would be visible on the screen. This makes it possible to run things like "rsh somehost sudo ls" since rsh(1) does not allocate a tty. This flag is off by default.
I suppose you have to make the change on local machine, not the remote.
 
Old 06-08-2012, 01:36 AM   #7
mahesh manakawad
LQ Newbie
 
Registered: May 2012
Posts: 11

Original Poster
Rep: Reputation: Disabled
Hi Slackyman,

Can you explain me what changes I need to do in local machine?
 
Old 06-08-2012, 01:55 AM   #8
Slackyman
Member
 
Registered: Mar 2011
Location: Rome - Italy
Distribution: Slackware 13.1
Posts: 347

Rep: Reputation: 44
Add a line in /etc/sudoers containing
Code:
Defaults visiblepw
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] default root, user is not in the sudoers file csj Linux - Newbie 12 10-29-2011 08:37 AM
Fedora /etc/sudoers file and sudoers.d directory davejjj Linux - Newbie 2 10-21-2011 07:19 PM
default vim + slackware 12. canīt paste from X using midclick?? need confirmation hottdogg Slackware 4 07-09-2008 12:48 PM
I deleted /etc/sudoers and creates a new file call sudoers but now it doesnt for visu abefroman Linux - Software 1 11-10-2005 06:03 PM
Ctrl+C Confirmation pjpeter Linux - Newbie 2 09-25-2004 06:49 PM


All times are GMT -5. The time now is 11:16 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration