PDA

View Full Version : Using dial-up modem without root acount



Loi
10-12-2005, 01:00 PM
Hi ppl

How can i use Dial-up modem with a new user. (without root). can you help me please?

markpreston
10-12-2005, 06:36 PM
I think you need to be root to configure the connection.
Once you have established the connection then it is possible to edit
/etc/ppp/options
/etc/ppp/pap-secrets
/etc/ppp/peers
/etc/ppp/chap-secrets
to enable new users.
See

http://www.linuxjournal.com/article/5448
http://www.linuxjournal.com/article/5467

Regards,
Mark

Loi
10-17-2005, 08:23 AM
First i loggined as root and then i changed all files under /etc/ppp folder's group as staff
then i made a conf file to connect. i named it internet

now when i type "pppd call internet" its connecting to internet but it cant resolvs page's dns numbers.

its running as root so good. there is no problem with resolving pages.

now what will i do to fix this problem?

Loi
10-17-2005, 09:22 AM
note: im using loi acount with knoppix.

Cuddles
10-17-2005, 02:02 PM
Hi ppl

How can i use Dial-up modem with a new user. (without root). can you help me please?

As a tid-bit of information, I use KDE, and under the menu, you can find KPPP for Dial-up...

As your user, locate the KPPP menu entry, it is usually under, let me see where mine is...

KMenu -> Internet -> KPPP ( It may also be under another folder, like Administrator )

Chances are, when you start KPPP, it may want to know the Super User password, root password, it may need access to dome root user information... When you get it started, you will want to set up your connection, the modem, etc... Once it is set up though, you should have it already configured the next time you run it...

Once it is set, and working, placing the icon on your desktop, or in the taskbar, can make connecting a lot easier in the future... This is what I did, I have it right next to KMail and Mozilla, and also XChat icons.

This form of starting your "connection", is using your "user" account, and not "root", you can verify this, by, using a very nice command in a root Konsole ps auxw - as seen below:

root@neo:~# ps auxw
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 120 56 ? S Oct15 0:00 init [5]

...

root 4116 0.0 0.0 2692 432 tty1 Ss+ Oct15 0:00 /sbin/getty 38400 tty1
root 4122 0.0 0.0 2692 432 tty2 Ss+ Oct15 0:00 /sbin/getty 38400 tty2
root 4123 0.0 0.0 2692 432 tty3 Ss+ Oct15 0:00 /sbin/getty 38400 tty3
root 4124 0.0 0.0 2692 432 tty4 Ss+ Oct15 0:00 /sbin/getty 38400 tty4
root 4125 0.0 0.0 2692 432 tty5 Ss+ Oct15 0:00 /sbin/getty 38400 tty5
root 4166 0.0 0.0 2692 432 tty6 Ss+ Oct15 0:00 /sbin/getty 38400 tty6

...

cuddles 32188 0.0 1.8 78940 19080 ? S 07:28 0:00 kppp -icon kppp -miniicon kppp
root 32189 0.0 1.1 60744 11368 ? Ss 07:28 0:00 kppp -icon kppp -miniicon kppp
root 32198 0.0 0.1 13960 1596 ttyS0 Ss+ 07:29 0:00 pppd 57600 -detach call kppp-options xonxoff defaultroute usepeerdn
cuddles 32241 0.1 3.4 129052 35780 ? S 07:29 0:01 kmail -check -caption KMail -icon kmail -miniicon kmail
cuddles 32575 1.5 3.3 179648 34316 ? Sl 07:32 0:14 /usr/lib/mozilla-firefox/firefox-bin -a firefox http://www.knoppix.
cuddles 312 0.0 0.9 95140 9772 ? Sl 07:45 0:00 kio_pop3 [kdeinit] kio_pop3 pop3 /tmp/ksocket-cuddles/klaunchergTRP

...

root@neo:~#

The output was rather long, I have a lot of stuff running, that wasnt needed for this example, but, as you can see, my KPPP is running under my "user" account, as well as my email, and my browser. Not sure why an entry exists for KPPP as user root, but, that may be for access to the modem. ( not sure of this, this is conjecture )

I have been using the "provided" KPPP dialer from KDE since I started using Knoppix, and now, with Kanotix, and the set up for it, is pretty simple... Set up your modem, where your modem resides, set up your user login and password, test, and get online. I also include my "user" accounts in the /etc/group file under modem, or it could be a group called "dialup", or something like that. But, using KPPP has been nothing less than painless, all this time.

Hope this helps,
Ms. Cuddles

markpreston
10-17-2005, 09:57 PM
I agree Cuddles that Kppp is usually excellent, but when it fails to work for whatever reason you need to be able to find another way if at all possible.
Loi, what is your output from

tail -f /var/log/ppp_article ? (assuming you followed the articles)

At a guess does your /etc/ppp/peers/internet file contain the usepeerdns option?
e.g. does it look something like this

/dev/modem
115200
modem
lock
connect /etc/ppp/chat-connect
user loi
defaultroute
usepeerdns

regards,
Mark

Loi
10-18-2005, 07:15 AM
I did everythink you said. But its still not working on loi user acount. Its connecting but cannot resolvs pages. :(

markpreston
10-18-2005, 07:54 AM
Sorry to hear it's still not working as user loi.
You must be quite close to achieving your aim.
It sounds like a permissions problem of some sort.
What' is the output from
tail -f /var/log/ppp_article
when you connect as user loi?
Compare this to the output as user root and it might give you some clues.
Regards,
Mark

Loi
10-18-2005, 01:57 PM
i tryed that...
log messages are same but noticed that i cant see /etc/resolv.conf when im using loi acount. i did chgrp staff /etc/resolv.conf then on root acount but i still cant see resolv.conf with vi.. maybe when im using loi acount cant read resolv.conf under /etc thats why firefox doesnt work.. i changed mods of resolv.conf and i still cant read it.. what can i do for it?

markpreston
10-19-2005, 10:40 PM
Hi Loi,
Re:
log messages are same
It would be helpful from my point of view to know what these messages are i.e. the exact output from

tail -f /var/log/ppp_article

If they are the same for root and user loi then you have effectively connected to the internet as user loi and you are unable to view web pages for some reason.

It would also be helpful to know what version of Knoppix you are running and whether it is a hard disk installation. I am presuming it is at present.
Recent versions of Knoppix have vim as text editor replacing vi, and some versions (Knoppix 3.3 certainly) still have vi as an editor to select from drop down menus, but this just dies on selection because vim is actually installed instead.
More recent versions of Knoppix restrict use of the X-server - see

http://www.knoppix.net/forum/viewtopic.php?t=17347
http://www.knoppix.net/forum/viewtopic.php?t=20457
http://www.knoppix.net/forum/viewtopic.php?t=18459

amongst others for details on this. Suffice to say that most recent hard-disk installed versions of Knoppix will cause user loi applications to fail if you are already using root user in a graphical environment. This may be one possible reason for your browser falling over.

If you are not actually managing to connect to the internet as user loi because of problems with resolv.conf access, then maybe this advice taken from plusnet (my ADSL provider) may help. This, or similar advice, is available elsewhere on the internet as well.


Sometimes Linux customers can have problems connecting with Linux and PPP, although we do not support linux here is something that may overcome connection problems for you.
1. Add "usepeerdns" to
/etc/pp/options
2. modify the scripts
/etc/ppp/ip-up and
/etc/ppp/ip-down
as follows
ip-up

This sample code shows you one way to modify your setup to allow automatic configuration of your resolv.conf for peer supplied DNS addresses when using the usepeerdns option.

In my case I just added this to my /etc/ppp/ip-up.local script. You may need to create an executable script if one does not exist.

You will also need to add the following to your ip-up.local and ip-down.local scripts:-

Please add to your ip-up.local script:-
if [ -n "$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then
rm -f /etc/ppp/resolv.prev
if [ -f /etc/resolv.conf ]; then
cp /etc/resolv.conf /etc/ppp/resolv.prev
grep search /etc/ppp/resolv.prev > /etc/resolv.conf
grep nameserver /etc/ppp/resolv.prev >> /etc/resolv.conf
cat /etc/ppp/resolv.conf >> /etc/resolv.conf
else
cp /etc/ppp/resolv.conf /etc
fi
chmod 644 /etc/resolv.conf
fi

Please add to your ip-down.local script to restore the original state:-
if [ -n "$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then
if [ -f /etc/ppp/resolv.prev ]; then
cp -f /etc/ppp/resolv.prev /etc/resolv.conf
else
rm -f /etc/resolv.conf
fi
chmod 644 /etc/resolv.conf
fi





Regards,
Mark

Loi
10-24-2005, 11:42 AM
Hi ppl,

Thank you for everything but i couldnt find a solition.. now i wont try anymore. cos im really bored..

Loi
11-08-2005, 04:09 PM
you have to register your user to these groups;

audio,
cdrom,
dialout,
dip,
fax,
floppy,
games,
usb,
users,
video,
voice.

after then you can connect to internet with your dial-up modem.


:)