LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   connect wvdial as non-root user? (https://www.linuxquestions.org/questions/linux-software-2/connect-wvdial-as-non-root-user-348563/)

cdhgee 07-31-2005 09:54 AM

connect wvdial as non-root user?
 
I use wvdial to connect to the internet. However, for some reason I have to run it as root or using sudo. When I try running wvdial as an unprivileged user, I get

Code:

--> WvDial: Internet dialer version 1.54.0
--> Cannot open /dev/ttySHSF0: Device or resource busy
--> Cannot open /dev/ttySHSF0: Device or resource busy
--> Cannot open /dev/ttySHSF0: Device or resource busy

If I make wvdial setuid and setgid root, it all works fine. I'd like to avoid running wvdial as stuid and setgid if at all possible.

I've checked the permissions on /dev/ttySHSF0 (the modem) and they seem fine:

Code:

crw-rw-rw-  1 root uucp 240, 64 Jul 31 15:48 /dev/ttySHSF0
How can I make wvdial work under a normal user account or isn't it possible?

fenderman11111 08-01-2005 12:22 AM

you can do one of two things.

create a group called something like 'dialout'. change the ownership/permissions of your /dev/ttySxxx to allow everyone from the group 'dialout' to be able to use the modem. then, add yourself to that group.

or, "sudo wvdial".

-brandon

foo_bar_foo 08-01-2005 01:44 AM

check all this before you go typing (paths and what it is already and whatnot)
pppd has to be setuid root (can't get around that one and i thing it's designed to be safe)
make and then add yourself to dialup group in /etc/group like fenderman said
chmod g+w dialup /dev/ttyS0
(fix it in udev rules later)
chmod g+w dialup /etc/ppp/pap-secrets /etc/ppp/chap-secrets

it is kind of bad to run wvdial as sudo or suid just because the authors didn't intend but alot of people do it with no ill effects

perfect_circle 08-01-2005 01:53 AM

you may also need to change the permissions in files like /etc/resolv.conf or /etc/ppp/resolv.conf if you get the ISP's DNS servers automatically on dial-up.
I would suggest using sudo. Make sure you have the latest sudo, because If I remember correct they found a security vulnerability in sudo recently. The group thing sound also correct to me.

cdhgee 08-01-2005 02:37 AM

Thanks for all the input. The thing I don't understand though is why I can't access the modem as an unprivileged user, because its permissions are set to

Code:

crw-rw-rw-  1 root uucp 240, 64 Jul 31 15:48 /dev/ttySHSF0
So in theory I shouldn't have to add myself to any new groups. Unless I'm misssing something.


All times are GMT -5. The time now is 11:17 AM.