LinuxQuestions.org
Visit Jeremy's Blog.
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 06-05-2009, 02:31 AM   #1
jitendriya.dash
LQ Newbie
 
Registered: May 2009
Posts: 7

Rep: Reputation: 0
Exclamation Sudoer Help ........


Hi,

When i use command "sudo -l" under my user, it gives me the following list.

(root) NOPASSWD: /bin/chgrp
(root) NOPASSWD: /bin/chmod
(root) NOPASSWD: /bin/chown
(root) NOPASSWD: /bin/mkdir
(root) NOPASSWD: /bin/su - hubsup
(root) NOPASSWD: /bin/su hubsup
(root) NOPASSWD: /bin/vi *.conf
(root) NOPASSWD: /bin/vi *.xml
(root) NOPASSWD: /usr/bin/find
(root) NOPASSWD: /usr/bin/passwd

(hubsup) NOPASSWD: ALL

Actually I am a bit confused for "/bin/su" command access.

For the lines with "/bin/su" , what does this mean exactly ? Does this mean that, I can do "\sudo su - hubsup" OR "\sudo su -l - hubsup" i.e. switching to hubsup user , which won't ask me for any password.

Actually, I tried with "\sudo su - hubsup" OR "\sudo su -l - hubsup" , from my user account, but, I was not able to switch to "hubsup" user.

with command, "\sudo /bin/su - hubsup" , i am getting blank output on the screen. Pressing enter key, is showing "WinSCP: this is end-of-file:0
" again and again. Then, I need to press ctrl+C to come out of the execution.

Can you please help me, in understanding, what is the meaning of "(root) NOPASSWD: /bin/su - hubsup" and how I can make use of "su" command, from my user-account here. (to switch to "hubsup" user)

Please help.

Thanks and Regards,

Jitendriya Dash.
 
Old 06-05-2009, 02:41 AM   #2
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
Which distribution is this?

Note: when I run that command, the first line is:

User simon may run the following commands on this host:

... you do not mention this appearing for you. Does it?

Quote:
I tried with "\sudo su - hubsup" OR "\sudo su -l - hubsup" , from my user account, but, I was not able to switch to "hubsup" user.
What happened instead? Did you get an error message?

Why do you keep putting a backslash before the "sudo".

Quote:
how I can make use of "su" command, from my user-account here
sudo su hubsup

http://kb.iu.edu/data/amyi.html

Note - it is frowned upon to set up sudo without needing a password.
 
Old 06-05-2009, 03:14 AM   #3
jitendriya.dash
LQ Newbie
 
Registered: May 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Exclamation Thanks a lot.. Further Inputs required...

Hi,

Thanks a lot, for your response. I am giving my outputs, with the following commands.

------------------------------------------------
PROMPT > /appl/local/bin/sudo /bin/su - hubsup

WinSCP: this is end-of-file:0

WinSCP: this is end-of-file:0

PROMPT > sudo /bin/su - hubsup
sudo: sorry, you are not allowed to preserve the environment

-------------------------------------------------

Even, when I am trying sudo su - $USER , it is not working, showing as, not authorized.

NOTE:-
with sudo -l , it is showing this line about user "hubsup".

---------------------------------
(root) NOPASSWD: /bin/su - hubsup
---------------------------------

So, my only concern is, this access is given in sudoer, but still I am not able to use su to user "hubsup".

Please share your views on the same.

Thanks and Regards,

Jitendriya Dash.
 
Old 06-05-2009, 05:02 AM   #4
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
Quote:
WinSCP: this is end-of-file:0
You are accessing the terminal via some remote client?
Quote:
sudo: sorry, you are not allowed to preserve the environment
So do not try to preserve the environment.

The entry does not make much sence - if you want to executo a command as hubsup (hub supervisor?) when you are logged in as a regular (but sudo) user, then why not

sudo -u hubsup <command>

The sudo -l entry is telling me that your user can act as root, without password, when executing the command /bin/su - hubsup

... what is the sudoers entry for this?

Quote:
(root) NOPASSWD: /bin/su - hubsup
(root) NOPASSWD: /bin/su hubsup
I suspect that the subsequent entry has overridden the one you are trying to use.
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't get sudoer to work right davidstvz Suse/Novell 3 08-27-2008 06:27 PM
not in sudoer file Ishmile Linux - Newbie 1 03-19-2008 12:23 PM
sudoer spidna Slackware 2 10-17-2006 02:51 AM
Sudoer??? SBN Linux - Software 1 10-03-2006 11:15 PM
/etc/sudoer mikz Linux - General 1 02-25-2005 02:04 PM


All times are GMT -5. The time now is 11:33 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration