Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
03-22-2006, 02:08 PM
|
#1
|
LQ Newbie
Registered: Mar 2006
Posts: 11
Rep:
|
/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.
|
|
|
03-23-2006, 09:16 AM
|
#2
|
Senior Member
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515
Rep:
|
/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?
|
|
|
03-23-2006, 09:59 AM
|
#3
|
Senior Member
Registered: Sep 2005
Location: Out
Posts: 3,307
Rep:
|
I know how to do it for usb scanner but not for scsi.
Maybe have a look here:
man sane-scsi
|
|
|
03-24-2006, 07:12 AM
|
#4
|
LQ Newbie
Registered: Mar 2006
Posts: 11
Original Poster
Rep:
|
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.
|
|
|
03-24-2006, 08:12 AM
|
#5
|
Moderator
Registered: May 2001
Posts: 29,415
|
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.
|
|
|
03-24-2006, 09:50 AM
|
#6
|
Senior Member
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515
Rep:
|
You have a point there, unSpawn.
|
|
|
03-27-2006, 01:39 PM
|
#7
|
LQ Newbie
Registered: Mar 2006
Posts: 11
Original Poster
Rep:
|
unSpawn - Thanks! I wasn't aware that sudo had the option of not having to enter the password. This looks like a great solution. 
|
|
|
All times are GMT -5. The time now is 10:40 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|