MJ Ray wrote:
Dave Cooper dave@accuramatic.co.uk wrote:
As su, chmod 777 /dev/ttyS0 fixes it, but only until it happens again. ttyS0 appears to be owned by root. It seems to me maybe it should be owned something/someone else to fix this permissions problem but I don't have a clue who. Can anyone put me right on this please?
Look at what group ttyS0 belongs to. Try ls -l /dev/ttyS0 The group name will probably be just after the "root". Then, add your user(s) to that group with the command usermod -a -G whatevergroupnameitsaid username
Yes! That works! Thanks Paul, thanks MJ (hope your head's still above water in the soggy south-west?). Just one supplementary question? How does that
usermod -a -G whatevergroupnameitsaid username
work? Why doesn't it need to include any mention of ttyS0??
thanks, Dave
or if that doesn't work, edit /etc/group to add the username to the end of the line starting with whatevergroupnameitsaid.
Alternatively, change the permissions on /dev/ttyS0 forever. These days, that's often done by udev, so grep -r /etc/udev/rules ttyS to try to find where the MODE is set.
Hope one of those works for you,
On 18 Jan 10:22, Dave Cooper wrote:
MJ Ray wrote:
Dave Cooper dave@accuramatic.co.uk wrote:
As su, chmod 777 /dev/ttyS0 fixes it, but only until it happens again. ttyS0 appears to be owned by root. It seems to me maybe it should be owned something/someone else to fix this permissions problem but I don't have a clue who. Can anyone put me right on this please?
Look at what group ttyS0 belongs to. Try ls -l /dev/ttyS0 The group name will probably be just after the "root". Then, add your user(s) to that group with the command usermod -a -G whatevergroupnameitsaid username
Yes! That works! Thanks Paul, thanks MJ (hope your head's still above water in the soggy south-west?). Just one supplementary question? How does that
usermod -a -G whatevergroupnameitsaid username
work? Why doesn't it need to include any mention of ttyS0??
Because it's not operating on the device, it's adding your user to a group that has permissions on that device. Things in /dev are just "special" files, it doesn't matter exactly what they are as far as filesystem permissions are concerned.
Hope that makes sense,
Brett Parker wrote:
On 18 Jan 10:22, Dave Cooper wrote:
MJ Ray wrote:
Dave Cooper dave@accuramatic.co.uk wrote:
As su, chmod 777 /dev/ttyS0 fixes it, but only until it happens again. ttyS0 appears to be owned by root. It seems to me maybe it should be owned something/someone else to fix this permissions problem but I don't have a clue who. Can anyone put me right on this please?
Look at what group ttyS0 belongs to. Try ls -l /dev/ttyS0 The group name will probably be just after the "root". Then, add your user(s) to that group with the command usermod -a -G whatevergroupnameitsaid username
Yes! That works! Thanks Paul, thanks MJ (hope your head's still above water in the soggy south-west?). Just one supplementary question? How does that
usermod -a -G whatevergroupnameitsaid username
work? Why doesn't it need to include any mention of ttyS0??
Because it's not operating on the device, it's adding your user to a group that has permissions on that device. Things in /dev are just "special" files, it doesn't matter exactly what they are as far as filesystem permissions are concerned.
Hope that makes sense,
Yes, it does. I see that I was making the error of assuming that because the groups are listed as 'properties' of /dev/ttyS0 that's where you'd need to change them. Thank you for that. Dave