Monday, March 15, 2010

Linux Desktop: Running WvDial without Root Permission

wvdial without root permission in linuxWvDial in combination with PPP is the best dialup internet solution for any Linux Desktop. There are a couple of ppp-frontends such as gnome-ppp and kppp for dialup internet access, but none are as versatile, configurable and intelligent as WvDial. However, the biggest turndown in WvDial is - it asks for root permission (except Mepis, Warren has done wonders to Mepis wherein you just have to enter wvdial, no need to be root at all). Everytime you need to do su or sudo wvdial and enter root password, it's a pain for no perceivable gain. Fortunately, you can get rid of it following a few simple tweaks.

1. Install ppp and wvdial using your distribution's repository. Let the package manager pull-in all the dependencies.
2. Generate/configure valid wvdial.conf file in /etc
For my idea net setter edge-enabled Huawei wireless modem I had to customize my wvdial.conf as mentioned below.

[Dialer Defaults]
Modem=/dev/ttyUSB0
Baud = 115200
Init 1 = AT+CGMM
Init 2 = AT+CMEE=1
Init 3 = ATE0
Init 4 = AT^HS=0,0
Init 5 = AT+CFUN?
Init 6 = AT+CLCK="SC",2
Init 7 = AT+CPIN?
Init 8 = AT+CLCK="SC",2
Modem Type = USB MODEM
Phone=*99#
Username = 9990146746
Password = 6746
New PPPD = yes
Dial Command=ATDT
Stupid Mode=1
ISDN=0

3. Open terminal, be a root user (su or sudo) and do:

adduser USERNAME dip
adduser USERNAME dialout

where USERNAME is your userlogin name.

4. Locate pppd (generally it's /usr/sbin/pppd) with root permission run the following commands in a terminal

chmod o+x pppd
chmod g+s pppd

5. Finally, change permissions of pap-secrets and chap-secrets

chown USERNAME /etc/ppp/pap-secrets
chown USERNAME /etc/ppp/chap-secrets

You're done!

Now open a terminal and run wvdial as a non-previleged (non-root) user.

running wvdial without root privilege

No comments:

Share your thoughts