LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 08-16-2004, 03:10 PM   #1
xviddivxoggmp3
Member
 
Registered: Feb 2004
Location: scanf
Distribution: Redhat Enterprise 4.4 AS
Posts: 236

Rep: Reputation: 30
visudo


i executed the visudo command to edit the sudoers file.
every time i exit with ctrl-z i brings me to
sh-2.05b#
pompt, when i try to exit from the prompt by typing exit, it brings me back into the sudoers file.
on top of it all my alterations to my sudoers file do not work.
Code:
%buddha DarkStar=(ALL) NOPASSWD:/bin/mount[A-Z]*
%buddha DarkStar=(ALL) NOPASSWD:/bin/umount[A-Z]*
%buddha DarkStar=(ALL) NOPASSWD:/sbin/shutdown[A-Z]*
here are my aliases i created that should use the sudo file
Code:
alias sd="sudo shutdown -h now"
alias rb="sudo shutdown -r now"
alias cdrom="sudo mount /dev/cdrom /home/buddha/cdrom"
alias ucdrom="sudo umount /dev/cdrom"
anyone have a clue how to fix these two problems.
the exiting of root to the wrong prompt, and the fact that my sudo changes didn't take.
thanks ahead of time.
 
Old 08-16-2004, 03:36 PM   #2
320mb
Senior Member
 
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577

Rep: Reputation: 47
Re: visudo

Quote:
Originally posted by xviddivxoggmp3
i executed the visudo command to edit the sudoers file.
every time i exit with ctrl-z i brings me to
when you exit vi and want to save the changes the command is.........

Code:
:wq!
 
Old 08-16-2004, 03:46 PM   #3
Mephisto
Member
 
Registered: Oct 2002
Location: Washington D.C, USA
Distribution: Slack 12, Etch, Gutsy
Posts: 453

Rep: Reputation: 30
why the "!"? That is to force exit, whether saved or not. Could you not do just ":wq" Note: These are questions not statements. I just do a :wq if saving and closing and :q! if I don't want to save, but I don't know the ins and outs of different switches are.

EDIT: of course you will want to make sure to leave insert mode before using any : command. <esc> will take you out of insert mode if you are in it.

Last edited by Mephisto; 08-16-2004 at 03:48 PM.
 
Old 08-16-2004, 03:50 PM   #4
Mephisto
Member
 
Registered: Oct 2002
Location: Washington D.C, USA
Distribution: Slack 12, Etch, Gutsy
Posts: 453

Rep: Reputation: 30
The aliases should be fine once you fix up the sudoers file.
 
Old 08-16-2004, 04:15 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,978
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
And Ctrl-Z in general just back-grounds a process :)


Cheers,
Tink
 
Old 08-17-2004, 12:08 AM   #6
xviddivxoggmp3
Member
 
Registered: Feb 2004
Location: scanf
Distribution: Redhat Enterprise 4.4 AS
Posts: 236

Original Poster
Rep: Reputation: 30
I keep getting the error.
it asks me for a password, but i didn't think it was sapposed to do that.
then it says the following after i put in the root password.
Code:
buddha is not allowed to run sudo on localhost. This incident will be reported.

Last edited by xviddivxoggmp3; 08-17-2004 at 12:10 AM.
 
Old 08-17-2004, 01:21 AM   #7
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 51
"%buddha DarkStar=(ALL) NOPASSWD:/sbin/shutdown[A-Z]*"

the % means group, if you want the user try without the %
 
Old 08-17-2004, 08:19 PM   #8
xviddivxoggmp3
Member
 
Registered: Feb 2004
Location: scanf
Distribution: Redhat Enterprise 4.4 AS
Posts: 236

Original Poster
Rep: Reputation: 30
i got it to work on my redhat box with the following
Code:
buddha localhost= NOPASSWD:/bin/mount /dev/cdrom /mnt/cdrom
buddha localhost= NOPASSWD:/bin/umount /dev/cdrom
buddha localhost= NOPASSWD:/sbin/shutdown -h now
buddha localhost= NOPASSWD:/sbin/shutdown -r now
but it doesn't work on the slackware box
I tried to execute these programs remotely and local.

Code:
buddha is not allowed to run sudo on localhost. This incident will be reported.
is there another way to fix this?

[edit1]
I figured it out.
I needed to do change the name in the command to the following. I was having issues going from one box to the other writing the files, due to the monkey brain has short term memory problems.
Code:
buddha DarkStar= NOPASSWD:/sbin/shutdown -r now
[/edit1]

Last edited by xviddivxoggmp3; 08-20-2004 at 12:28 AM.
 
  


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
Save Visudo and exit acbenny Linux - General 7 05-05-2011 12:33 PM
visudo and pico crud Slackware 3 03-16-2005 04:51 AM
Need help with visudo powadha Debian 2 12-19-2004 05:04 AM
Modifying sudo timeout via visudo jonr Linux - Security 1 08-25-2004 12:25 AM
visudo: command not fund....how can I find it? mfries Linux - Newbie 2 04-11-2004 07:34 PM


All times are GMT -5. The time now is 03:16 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