Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I am very new to Red Hat Linux 8 and have been using and having fun with the Gnome desktop under X-Windows. I decided to use the graphical interface to gently introduce Linux before moving on to the power of the shell. I recently found the cool modem lights applet that simulates the lights of an external modem. There is one problem I am having that I can't figure out how to solve. I can use the applet to connect to or disconnect from the internet with a single click only as the root user. When I am logged in as a user other than root, the applet still lights when I am connected and shows the throughput and modem status, but when I attempt to connect using the applet the normal confirmation box pops up and when I try to connect or disconnect the modem nothing happens. The settings for the applet appear to be correct in my case - it finds the modem at ttyS1 and set up a lock file, but apparently users other than root can only read the lock file. Hopefully, I haven't been too confusing in all this rambling, but if anyone can help I thank you in advance!
Jailbait: Just read the "Quick and Dirty Guide Linux File Permissions" here and I think I understand what to do to change the permissions when I get home tonight. IMy intuition is that the permissions on /dev/ttyS1 are not the problem, but I will give it a shot as you suggest just in case. I will post back with the result. Thanks again!
OK. I changed the permissions on /dev/ttyS1 with chmod and checked them. Before I connect to the internet the permissions read crwxrwxrwx 1 root uucp. I tried to then connect with the modem lights applet still can't connect. I now connect with "network device control" and the permissions on /dev/ttyS1 change to crwxr-xr-x 1 root uucp. See, I can and always could connect using my modem with "network device control" as either root or another user. As root I can also connect or disconnect with a single click on the modem lights applet; but as a user other than root the applet displays throughput and lights up properly but won't allow me to connect or disconnect with it. I hope this isn't all too redundant, but I just wanted to make it clear what is happening. It is obviously only a minor issue because my modem can connect fine. It's just slightly inconvenient and a little baffling that the applet only works fully when I am the root user. And I can't figure out why.
I am not sure what the key to this puzzle is. With permissions of crwxr-xr-x then the behavior of the modem lights applet is easily explained by the fact that the modem lights applet can not write to the modem. Therefore it cannot issue commands to the modem to connect and disconnect.
"I now connect with "network device control" and the permissions on /dev/ttyS1 change to crwxr-xr-x 1 root uucp."
So network device control changes permissions on /dev/ttyS1 and only allows root to write to the modem which means that only root can connect or disconnect the modem. This brings up two questions in my mind.
When you connect to the internet using network device control does it ask you for the root password so that network device control can run as root? Not only does network device control have to run as root to write to the modem with the crwxr-xr-x permissions, it also has to run as root to change the permissions.
Have you tried running the modem lights applet when the permissions are, for sure, crwxrwxrwx? If the answer is yes then I am puzzled as to what is changing the permissions every time /dev/ttyS1 is accessed if it is not network device control.
I just tried an experiment with my Fedora system. I set the permissions of my modem, /dev/ttyS1, to 777. Then I started kppp which, as usual, asks for my root password. Immediately after I connect to my ISP my /dev/ttyS1 permissions become crwxr-xr-x. So something in kppp reset my /dev/ttyS1 permissions which is a new idea to me.
Did you try what I mentioned, because devices aren't like files so they don't keep the permissions when changed. In other words, the "files" in the /dev folder are not files, but instead they are parts of your system made to look like files so that the OS can access them with ease so all changes to the permissions will be shortly stored in RAM. So add the name you want to allow to connect/disconnect to the tty group.
Pwnz3r: I tried your suggestion, but it had no effect on the behaviour. Just to check to see if I did it right - I logged in as root and in the file etc/group I typed in the user name at the end of the line
tty:x:5: Then I saved the file, logged out of root, and logged in as user. If those were the right steps, it didn't work - still can't connect or disconnect through the modem lights applet as user other than root.
Jailbait: When I connect to the internet using network device control it does not prompt me for the root password when I am a user other than root; I just select the modem, click "activate" and then the modem dials right in and connects.
Try becoming root and doing "chmod u+s /usr/sbin/pppd".
Modemlights doesn't know about making/breaking a ppp connection, itself, it calls scripts to do this. Which scripts are called is configurable by clicking modemlights->properties. The scripts are probably ppp-on and ppp-off, and they are probably in /usr/sbin. You can call them from the commandline to get the same effect as clicking the modemlights button. ppp-on, in turn, calls pppd, which sets up the ppp connection for you. You can examine the script ppp-on and use "man pppd" to get the details. To do its work for non-root users, pppd has to have root privileges, so it has to be made suid root. It's my guess, that is what is going wrong for you. pppd was not installed suid root, so that's what you have to change to fix it.
GregLee: Thanks for the info on pppd. Your suggestion indirectly helped me solve my problem. In my case, the script being called by modem lights to connect is "ifup ppp0" and to disconnect is "isdown ppp0". I tried typing the command directly from a command line first as root and the as a non-root user. As root the modem would connect and disconnect immediately. But as a non-root user I would get the message "Failed to execute command: no such file or directory" when I tried typing the command directly. I did a search for "ifup" and found that it was in the /sbin directory. Typing the command as /sbin/ifup ppp0 connected smoothly so I just changed the appropriate lines in the preferences of modem lights to correspond. I would guess that what was happening was that when the command was issued as root, /sbin was already in the root user's "path" ( to use a Windows/DOS analogy), while it is not in a non-root user's "path". Now that I have the applet working as desired, I am going to experiment by "chmod"ing all the files I changed the permissions on back to the way they were when I originally posted to see if that has any effect on the behaviour . So, what started as a simple question ended up leading me to learn about permissions and how to change them and is now leading me to investigate whether there is a concept of "path" in Linux. Thanks again to everyone who posted and helped!