Solved

Creating an Account with some root permissions

Posted on 2000-03-01
4
215 Views
Last Modified: 2013-12-16
Hi there,

I'm using linux to communicate with external devices by serial or parallel ports. However, I must be root or set root permissions to my prog for accessing to these io ports. What I would like is to create an account which has root permissions for io ports but not for the rest such as accessing in Write mode to system files or accessing to /root directory.

How could I do this ?
0
Comment
Question by:daanen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 1

Expert Comment

by:bcoleman
ID: 2573403
All you have to do is change ownership and permission for the /dev/{whatever port} to the user.  What you might want to do is set up a group which have permission to access the ports and put those users who need access in that group.
0
 
LVL 3

Expert Comment

by:jyu_88
ID: 2573595
alternatively, you can use 'sudo' program to explicitly grant certain user/group to run a single program/a set of programs as root.
0
 
LVL 2

Accepted Solution

by:
Reinier earned 20 total points
ID: 2597141
Or you can create a special group for these devices. Say you want to give rw access to /dev/ttyS3 and /dev/ttyS4. Then you add a new group named "devusers" or whatever in /etc/group and /etc/gshadow, like this:

groupadd -g 300 devusers

The exact name and group numerical id are not important, but they must be unique. Next you have to add root and all usernames of the users that must acces the device, to this group. You can do this by hand-editing /etc/group, but you can probabely also use linuxconf or whatever setuptool that comes with your distro.

Then go to /dev, do

chown root:devusers ttyS[34]
chmod 664 ttyS[34]

and you're set.
0
 

Author Comment

by:daanen
ID: 2599453
Thanks for these answers. As I'm the unique user of my linux box, I just chmod 666 /dev/ttyS*. But in the future, I'll probably use Reinier's solution
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Linux FTP Error 5 59
DB2 - How to load results from a Stored Procedure into a table 8 34
Linux 3 59
SMTP log file for IMSVA 5 75
I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question