LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-19-2006, 08:34 PM   #1
M$ISBS
Member
 
Registered: Aug 2003
Posts: 834

Rep: Reputation: 30
How can I get as close to root priveledges without a security risk?


I just cannot figure out the way permissions work and alwasy get "only root can mount" my flash drive, and I have to log into root in KDE to burn CD`s and other tasks.
I use su but that doesnt help with alot of things.

So, my question is, how can I make it so I am almost root but without risking having a security problem?

Thanks
 
Old 12-19-2006, 08:52 PM   #2
granth
Member
 
Registered: Jul 2004
Location: USA
Distribution: Slackware64
Posts: 212

Rep: Reputation: 55
KDE has a tool that automatically changes your drive permissions.

Run /opt/kde/bin/k3bsetup as a regular user. It will ask for the root password when executed.


USB drives have been a pain in the ass. UDEV is the culprit. If you are able to assign your device a static name, you are doing great. The next step is making a fstab entry like the one below.(HINT: 'jed /etc/fstab' as root.)

/dev/cruzer /media/cruzer vfat noauto,users 0 0

(device) (mount point) (filesystem) (options)


The 'users' part of the fstab entry is where the magic happens. It allows any user to mount or unmount the drive.
 
Old 12-19-2006, 09:01 PM   #3
M$ISBS
Member
 
Registered: Aug 2003
Posts: 834

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by granth
KDE has a tool that automatically changes your drive permissions.

Run /opt/kde/bin/k3bsetup as a regular user. It will ask for the root password when executed.


USB drives have been a pain in the ass. UDEV is the culprit. If you are able to assign your device a static name, you are doing great. The next step is making a fstab entry like the one below.(HINT: 'jed /etc/fstab' as root.)

/dev/cruzer /media/cruzer vfat noauto,users 0 0

(device) (mount point) (filesystem) (options)


The 'users' part of the fstab entry is where the magic happens. It allows any user to mount or unmount the drive.
Ive moded fstab except for the users entry, I will try that. Thanks.
 
Old 12-19-2006, 09:07 PM   #4
M$ISBS
Member
 
Registered: Aug 2003
Posts: 834

Original Poster
Rep: Reputation: 30
I just appended fstab with users and now a window pops up like its mounting the flashdrive but another window pops up saying /mnt/flash does not exist, of course it does exist because I created it and just checked it, and its there

I can mount the flash drive from command line.
 
Old 12-19-2006, 09:14 PM   #5
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
Quote:
Originally Posted by granth
USB drives have been a pain in the ass. UDEV is the culprit.
I would argue that udev has made it much easier to manage usb drives.
Quote:
Originally Posted by granth
If you are able to assign your device a static name, you are doing great. The next step is making a fstab entry like the one below.(HINT: 'jed /etc/fstab' as root.)

/dev/cruzer /media/cruzer vfat noauto,users 0 0

(device) (mount point) (filesystem) (options)

The 'users' part of the fstab entry is where the magic happens. It allows any user to mount or unmount the drive.
See http://slackwiki.org/Windows_Partitions for more information on useful mount options and such when working with Windows filesystems.

--RW
 
Old 12-19-2006, 10:47 PM   #6
M$ISBS
Member
 
Registered: Aug 2003
Posts: 834

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by robw810
I would argue that udev has made it much easier to manage usb drives.

See http://slackwiki.org/Windows_Partitions for more information on useful mount options and such when working with Windows filesystems.

--RW
I can mount the flash drive from command line but would like to mount as user without the message telling me a directroy does not exist when i know it does.......
 
Old 12-20-2006, 12:19 AM   #7
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Place yourself in the 'wheel' group and uncomment one of the lines in /etc/sudoers for that group which lets you run all commands with or without password. You can also add /sbin and /usr/sbin to your path so you don't have to give the full path to programs in those directories.
 
Old 12-20-2006, 10:14 PM   #8
M$ISBS
Member
 
Registered: Aug 2003
Posts: 834

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by gnashley
Place yourself in the 'wheel' group and uncomment one of the lines in /etc/sudoers for that group which lets you run all commands with or without password. You can also add /sbin and /usr/sbin to your path so you don't have to give the full path to programs in those directories.
I am giving that a try, thanks all.
 
Old 12-21-2006, 01:13 AM   #9
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
Quote:
Originally Posted by gnashley
Place yourself in the 'wheel' group and uncomment one of the lines in /etc/sudoers for that group which lets you run all commands with or without password. You can also add /sbin and /usr/sbin to your path so you don't have to give the full path to programs in those directories.
I'm curious. Isn't that pretty much the same thing as running as root? If someone gained access to that user, then couldn't they could do anything root could? Seems like your nulifying your 1000+ UID by bypassing sudo passwords and adding the sbin's to your PATH... Otherwise, what's the point in running as a user? Legitimate questions because I just don't know.

Amazingly enough, security is one area of Linux I haven't delved into much besides a basic iptables and router setup.. I suppose running as root 24/7 for years without anything happening makes one very complacent.
 
Old 12-21-2006, 02:17 AM   #10
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
I also have nearly always run as root until recently, since most of the time I'm doing development work on the system itself. Since I now have my wife using the same system, I've set up a normal user account for myself for online work with only limited sudo priviledes.
I'm not sure what the full implications of this 'power-user' strategy might be, regarding network security. Seems that files with the sticky bit set might still be safe from removal or alteration and perhaps anything under /root.
I'd be interested to learn more on the subject.
Using the 'wheel' group but requiring the password should be fairly safe.
 
Old 12-21-2006, 03:28 PM   #11
granth
Member
 
Registered: Jul 2004
Location: USA
Distribution: Slackware64
Posts: 212

Rep: Reputation: 55
Quote:
I can mount the flash drive from command line but would like to mount as user without the message telling me a directroy does not exist when i know it does
Check the permissions for the directory. Sounds like the user does not have access.

Code:
chown root:wheel /mnt/flashdir
Code:
chmod 660 /mnt/flashdir
You must be a member of the group 'wheel'.

You should really do some research on udev. I think it will help you out with this.

http://www.reactivated.net/writing_udev_rules.html


I created a file in /etc/udev/rules.d/ called 10-udev.rules

The file contains the following line, which keeps the device name consistent. That udev rule in combination with my fstab entry works flawlessly. I can mount in KDE using my regular user account. No sudo or other unsafe root practices.

SUBSYSTEM=="block", SYSFS{model}=="U3 Cruzer Micro*", NAME+="cruzer"

This line will be different for your device.

Last edited by granth; 12-21-2006 at 03:38 PM.
 
  


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
Security Risk computerdude Linux - Security 3 08-31-2005 02:25 PM
Security Risk? N|k0N Linux - Security 7 10-02-2004 04:52 PM
is this a security risk? shanenin Linux - Security 8 11-02-2003 04:27 PM
Root priveledges? BajaNick Linux - General 2 07-30-2003 12:06 AM
security risk? Notfromkansas Linux - Security 12 04-04-2002 10:30 AM

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

All times are GMT -5. The time now is 09:39 AM.

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