LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-03-2011, 05:08 PM   #1
hedpe
Member
 
Registered: Jan 2005
Location: Boston, MA
Distribution: Debian
Posts: 380

Rep: Reputation: 30
any way to change socket permissions to regular users?


I would like regular users on my machine to be able to use tools like libpcap, tcpdump, etc. all on sockets which traditional require root permissions. For example, trying to capture packets over an interface as a regular user with tcpdump will return "Error: socket: Permission denied." Instead of granting root permissions to users, is it possible to change socket permissions to include specific (or simply all) users?

Last edited by hedpe; 04-03-2011 at 05:11 PM.
 
Old 04-03-2011, 07:49 PM   #2
thund3rstruck
Member
 
Registered: Nov 2005
Location: East Coast, USA
Distribution: Fedora 18, Slackware64 13.37, Windows 7/8
Posts: 386

Rep: Reputation: 43
You can edit the /etc/sudoers file using the visudo command to grant any user (or any group) permission to execute any specific program. On my network I have configured sudoers to allow all users in a group called smbusers the ability to run mount.cifs and umount.cifs
 
Old 04-03-2011, 08:26 PM   #3
hedpe
Member
 
Registered: Jan 2005
Location: Boston, MA
Distribution: Debian
Posts: 380

Original Poster
Rep: Reputation: 30
I kind of simplified the situation or the sake of brevity. Unfortunately sudo and su are not an option. Is it possible to change the socket permissions?

But thanks for the suggestion, I actually did not know you could do that on a per application basis
 
Old 04-04-2011, 08:11 AM   #4
thund3rstruck
Member
 
Registered: Nov 2005
Location: East Coast, USA
Distribution: Fedora 18, Slackware64 13.37, Windows 7/8
Posts: 386

Rep: Reputation: 43
Quote:
Originally Posted by hedpe View Post
I kind of simplified the situation or the sake of brevity.
I'll leave the specific socket question to someone more suited to answer that one but if su and sudo are not available you might look at the chmod +s permission.

The 's' execute option allows regular users to execute the program with the permissions of the owner. So if the command users need to execute (mount for example) is owned by root and you add the 's' permission then any user can execute the mount program and it will run as if being executed by root.

This probably doesn't help your socket permission but I thought I'd throw it out there just in case
 
Old 08-15-2011, 04:44 PM   #5
hedpe
Member
 
Registered: Jan 2005
Location: Boston, MA
Distribution: Debian
Posts: 380

Original Poster
Rep: Reputation: 30
resurfacing this one... +s is also not an option. does anyone know about the socket permissions?
 
Old 08-15-2011, 05:59 PM   #6
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
The specific application you mentioned (tcpdump, or any application based on libpcap) is not available to mortal users, because it requires the use of the ethernet in promiscuous mode. As such, it is capable of reading arbitrary data on the network, and this is not something that should be available without root permission. Without having checked, I would assume that this is enforced by the kernel, in the TCP stack, as is therefore not subject to any permission changes at the filesystem or socket level.

--- rod.

Last edited by theNbomr; 08-15-2011 at 06:01 PM.
 
Old 08-15-2011, 06:03 PM   #7
hedpe
Member
 
Registered: Jan 2005
Location: Boston, MA
Distribution: Debian
Posts: 380

Original Poster
Rep: Reputation: 30
Is there any way around this? I understand why it can be seen as malicious on a public machine, but this one is mine and Linux gives menthe power to modify it

Do you know what it is that prevents it? Is it something I can change through kernel modifications or is it part of something else?
 
Old 08-15-2011, 06:06 PM   #8
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
As I said, I haven't explored the low-level details, but I feel certain that it would involve modifying the kernel. As you said, 'Linux gives me the power to'.
--- rod.
 
Old 08-16-2011, 12:22 PM   #9
hedpe
Member
 
Registered: Jan 2005
Location: Boston, MA
Distribution: Debian
Posts: 380

Original Poster
Rep: Reputation: 30
it looks like all capabilities are checked by capable() in kernel/capability.c ... so it seems as though I can add statements to ignore certain capabilities (always returning true for them). Just wanted to update the thread with a viable solution.

A list of the capabilities: http://www.kernel.org/doc/man-pages/...ilities.7.html

Last edited by hedpe; 08-16-2011 at 12:24 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
Permissions: Can regular users add their network printer, like in windows ? frenchn00b General 0 03-08-2008 04:29 AM
[SOLVED] How can you change permissions on a folder for other users? StefanP Linux - Newbie 2 04-25-2007 01:46 PM
touch file in every users home, then change permissions paul_mat Linux - Networking 1 05-01-2006 06:06 PM
change permissions for regular users... questionasker Linux - General 6 01-26-2004 01:07 PM
Change permissions on NTFS partition to read for all users bax Linux - Newbie 6 05-13-2002 07:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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