LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 12-09-2006, 08:42 AM   #16
BashTin
Member
 
Registered: May 2003
Location: West Midlands, United Kingdom.
Distribution: Slackware 14.1, Centos 7
Posts: 278

Rep: Reputation: 32

Hi drkstr. Dont get it. Tried what you said above and many variants thereof but the darn thing keeps asking me for a pw

I must be doing something not right.

/etc/sudoers file mentions this file MUST be edited by running visudo?? Well I have edited with vi /etc/sudoers & visudo with the same result. Does it REALLY matter how I edit it??

Ok normal user acc paul is member of group paul and I just want him to be able to bring up the adsl connection as you sumised.

So any ideas?

Oh afer every edit of sudoers I run 'source .bashrc'

BashTin.
 
Old 12-09-2006, 11:45 AM   #17
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
Quote:
/etc/sudoers file mentions this file MUST be edited by running visudo?? Well I have edited with vi /etc/sudoers & visudo with the same result. Does it REALLY matter how I edit it??
It does not matter as long as the editor uses UNIX line breaks and not MS linebreaks. Any Linux editor *should* be fine.

Quote:
Oh afer every edit of sudoers I run 'source .bashrc'
First of all, it's 'source ~/.bashrc' and this is only necessary if you added aliases in a script located in your home directory called '.bashrc' (the ~ char is a shortcut to your home directory).

maybe these examples will help:

/etc/sudoers:
Code:
#drkstr is a member of the users group
%users ALL=/sbin/mount,/sbin/umount
drkstr ALL=NOPASSWD: /sbin/fdisk, /sbin/init
Code:
drkstr@dsk:~$ sudo fdisk -l

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

Password:
drkstr@dsk:~$
oops, got a password.

Code:
drkstr@dsk:~$ sudo /sbin/fdisk -l

Disk /dev/hdb: 40.9 GB, 40982151168 bytes
255 heads, 63 sectors/track, 4982 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdb1               1        4255    34178256   83  Linux
/dev/hdb2            4256        4982     5839627+  83  Linux
drkstr@dsk:~$
no password here though.


so let's create an alias:
Code:
#!/bin/bash
# /home/drkstr/.bashrc

#note: '.' is a shortcut for 'source'. the following line is optional, but I recommended it.
. /etc/profile

alias fdisk='sudo /sbin/fdisk'
Code:
drkstr@dsk:~$ fdisk -l
-bash: fdisk: command not found
drkstr@dsk:~$
oops, I forgot to import my new alias into my current shell

Code:
drkstr@dsk:~$ source ~/.bashrc
drkstr@dsk:~$ fdisk -l

Disk /dev/hdb: 40.9 GB, 40982151168 bytes
255 heads, 63 sectors/track, 4982 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdb1               1        4255    34178256   83  Linux
/dev/hdb2            4256        4982     5839627+  83  Linux
drkstr@dsk:~$
It works, yipee!


Hope this was some help, let me know if there is anything else that needs some more explaining.

best regards,
...drkstr

Last edited by drkstr; 12-09-2006 at 11:48 AM.
 
Old 12-09-2006, 05:55 PM   #18
BashTin
Member
 
Registered: May 2003
Location: West Midlands, United Kingdom.
Distribution: Slackware 14.1, Centos 7
Posts: 278

Rep: Reputation: 32
Lightbulb May the God Linus Be Praised

Success!!!!!

As normal quite simple error. After looking at your last post I realised I was seperating my list of commands with a ';' instead of a ',' and this is what was messing things up.

Did you know this commnand??

sudo -l
User paul may run the following commands on this host:
(root) /sbin/mount /cdrom
(root) /sbin/umount /cdrom
(root) NOPASSWD: /sbin/pppoe-start
(root) NOPASSWD: /usr/sbin/pppoe-stop
(root) NOPASSWD: /usr/sbin/pppoe-status

Also I found out that the correct way to edit sudoers is

visudo -f /etc/sudoers

'All' it does is provide a mechanism for locking the file while editing and providing some sanity checks after you save it.

Thanks for your help drkstr.

Off to post next problem, gettting my Gain QQ plugin and Skype to connect it you are interested

BashTin.
 
Old 12-10-2006, 12:27 AM   #19
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
No I did not, thanks for the tip. I usually have a root shell open (blasfimy, I know), so I have not used sudo very much in the past. I mainly just use it in my code when I need to pipe off a process that requires root. I should probably learn more about it since it seems like it can be quite useful.

Glad you got it working!
...drkstr
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Howto grant access for a user to qtparted? powadha Debian 2 06-17-2005 03:18 AM
remote desktop in suse 9.1 - grant access each session? spankmeister7 Linux - Networking 1 08-05-2004 02:34 AM
grant a user access to /fat-c n0x Slackware 4 05-02-2004 12:10 PM
my ISP has blocked grant access only to windows boxes????? could this be????? acarri Linux - Networking 13 03-19-2004 07:29 PM
firewall login to grant full access to specific IP JustinHoMi Linux - Security 2 04-24-2001 07:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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