LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-22-2006, 02:08 PM   #1
oldtincup
LQ Newbie
 
Registered: Mar 2006
Posts: 11

Rep: Reputation: 1
/proc permissions help


I am a newbie to linux but am using SuSE 10.0.

I have a scsi scanner that is used only occasionally so it is turned off most of the time. The scsi bus is apparently only scanned at boot up; so I had to reboot every time I wanted to use the scanner. Fortunately I found the script "rescan-scsi-bus.sh" which will find the scanner after it has been turned on. The problem is that this requires permission to /proc/scsi/scsi. I can run this fine as root, but I don't want to give out the root password too all the users (not that there are many, but, it is still a security issue).

How do I permanently give a user or group of users permission to /proc/scsi/scsi? Since I understand that /proc is a virtual file system I assume it is handled differently from the normal file system.
 
Old 03-23-2006, 09:16 AM   #2
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
/proc is indeed a "pseudo-filesystem". Since it contains information from the kernel's memory, making it
accessible to a bunch of users isn't very safe.

What you could try instead is allowing normal users to run the "rescan-scsi-bus.sh" script as if they were root.
This can be accomplished by:
-using sudo and configuring it to allow the script (and only the script) for the users you choose;
-enabling the setUID permission bit on the script and chown'ing it to root. You'll need to make sure that it is
in a safe place, like /sbin. Nobody but root may have write access on the directory it's stored in, or any of the directories above that directory (ie if you put it in /A/B/C, then only root may have write permission on A, B and C). This is important for security.

A final remark: why would normal users require the possibility to add (or remove) the scanner from the SCSI bus? Installing/uninstalling devices on your machine should be left up to root for safety. You don't allow any normal users to disable your graphics card or network card or anything like that either, so why should the scanner be any different?
 
Old 03-23-2006, 09:59 AM   #3
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
I know how to do it for usb scanner but not for scsi.
Maybe have a look here:
man sane-scsi
 
Old 03-24-2006, 07:12 AM   #4
oldtincup
LQ Newbie
 
Registered: Mar 2006
Posts: 11

Original Poster
Rep: Reputation: 1
timmeke - Thanks for the suggestion I will try the setUID. I was told that linux ignores the SUID bit for scripts and only recognizes it for binary executables. But, it is certainly worth a try.

I have the scanner drivers installed and configured. But if the scanner is turned off at boot up it will NOT be recognized even after it is turned back on. The script I found above is the only way I have found to recognize the scanner after boot. The scanner is only used occasionally, it would be a waste to leave it on all the time. I don't know about you, but, it seems unreasonable to me for a user to have to reboot the system every time he decides to use a device that didn't happen to be turned on at the time the system was booted. Maybe it is just me, I've been using Windows too long.


nx5000 - I will look into the man page further. It may also have some useful info. Thanks.
 
Old 03-24-2006, 08:12 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
I will try the setUID.
While setting this script setuid root won't matter much (won't work AFAIK) the default defense of using setuid root to overcome "problems" is a bad habit and should be discouraged. Especially in your case where using sudo really is the best option. It isn't that hard and you can even specify users to *not* use a password when executing the script. Just make sure your script and the sudoers entry does not allow users to supplying args.

Last edited by unSpawn; 03-24-2006 at 08:14 AM.
 
Old 03-24-2006, 09:50 AM   #6
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
You have a point there, unSpawn.
 
Old 03-27-2006, 01:39 PM   #7
oldtincup
LQ Newbie
 
Registered: Mar 2006
Posts: 11

Original Poster
Rep: Reputation: 1
unSpawn - Thanks! I wasn't aware that sudo had the option of not having to enter the password. This looks like a great solution.
 
  


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
how to know contents of /proc/ide/hda/smart_values and /proc/ide/hda/smart_threshold Prassanta SUSE / openSUSE 0 02-23-2006 04:21 AM
Correlation between /proc/devices and /proc/modules ColinLadyka Linux - General 1 02-13-2006 05:25 PM
Accidentally changed the permissions of /proc/, help restoring them please Th3James Linux - General 5 01-24-2006 03:24 AM
/proc Permissions VCore5.0 Linux - Security 3 11-28-2005 05:36 PM
What /proc proc file do I need? GoboFraggle Programming 1 02-04-2003 11:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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