CDP Forum Forum Index CDP Forum
NOTE: The forum is being replaced by support.icd.no
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Running CDP applications as non-root user on Linux.

 
Post new topic   Reply to topic    CDP Forum Forum Index -> Linux programming
View previous topic :: View next topic  
Author Message
Kent



Joined: 12 Sep 2008
Posts: 12

PostPosted: Wed 11 Mar 10:44:18 2009    Post subject: Running CDP applications as non-root user on Linux. Reply with quote

Normally CDP applications must be run as root user on Linux due to a lot of priviliges it needs, such as setting Real-Time priorities etc. If you wish to run it as a user, for instance during development and debugging on a desktop computer, you have a few options:

=== SUDO ===
Grant your user sudo rights (in /etc/sudoers) and start CDP like this:
Code:
sudo ./CDP


=== SUID ===
Make the binary owned by root and set it SUID and executable:
Code:
su
chown root CDP
chmod u+s  CDP
chmod a+rx CDP

You can then run the CDP application as any user:
Code:
./CDP


=== /etc/security/limits.conf ===
You can also escalate the priviliges of your user in general. Please see /etc/security/limits.conf where you'll want to allow real-time priorities and process priorities.

Example limits.conf:
Code:
username   -    rtprio      127
username   -    nice        -20

You'll have to log out and log in again for these settings to take effect. See "ulimit -a" for current priviliges and "man limits.conf" for more details.

NOTE: Unlike the other options, this does not run CDP as root user "under the hood". Thus there might be other priviliges you need to grant or limitations to work around, such as the default WebServer port 80. (Anything below port 1024 requires root on Linux.)
_________________
Kent Dahl - Software Developer
Industrial Control Design AS - http://www.icd.no/
Back to top
View user's profile Send private message
Kent



Joined: 12 Sep 2008
Posts: 12

PostPosted: Fri 12 Mar 12:08:23 2010    Post subject: Reply with quote

To allow non-root users to bind privileged ports (like 80), please refer to authbind command.

See Debian Administration article Running network services as a non-root user for details.
_________________
Kent Dahl - Software Developer
Industrial Control Design AS - http://www.icd.no/
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    CDP Forum Forum Index -> Linux programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group