Best Practice for Allowing non-root Users Access to Serial Port?

Roland Smith rsmith at xs4all.nl
Fri Apr 1 10:02:55 PST 2005


On Fri, Apr 01, 2005 at 11:17:14AM -0600, Martin McCormick wrote:
> 	What is the safest way to let non-root users access
> /dev/ttyd0?  I notice that in FreeBSD, /dev/ttydx is owned by
> root:wheel.  In linux, the ttySx's are in a special group so the trick
> there is to add users to that group and make sure the ttyS's are group
> writable.
> 
> 	Here, I want the users to be able to use C-kermit to talk to a
> remote device without them having to be root.

Since you want to dial out, I think you'll need to use /dev/cuaa*.

Making kermit users members of a group, and have that group own
/dev/cuaa* with read/write privileges seems like a good idea.

For instance, create a group "kermit" with 'pw groupadd kermit'. Then
you can use devfs(8) to change the ownership and permissions of the
relevant device: "devfs rule add path 'cuaa*' mode 0660 group
kermit". This setting will not survive a reboot, so you'll have to add the
following to /etc/devfs.rules: "add path 'cuaa*' mode 0660 group kermit".

Now add the relevant users to the group kermit: 
'pw groupmod kermit -m foo,bar,baz'

Roland
-- 
R.F. Smith                           /"\    ASCII Ribbon Campaign
r s m i t h @ x s 4 a l l . n l      \ /    No HTML/RTF in e-mail
http://www.xs4all.nl/~rsmith/         X     No Word docs in e-mail
public key: http://www.keyserver.net / \    Respect for open standards
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20050401/396adb99/attachment.bin


More information about the freebsd-questions mailing list