The Hayes Command Set might come handy if you need ot fine-tune your modem commands.
The following is based on an email by Keith Brown
PAP seems a lot more complicated at first glance than it really is. The server (the machine you are connecting to) basically tells the client (your machine) to authenticate using PAP. The client (pppd) looks in a specific file for an entry that contains a matching server name and client's name for this connection, and then sends the password it finds there. That's about it! Now, here's how to make that happen. I am assuming a pppd version of 2.2.0 and a standard installation of configuration files under /etc/ppp.
For the purposes of illustration, pretend that I have an Internet account
with 'glob.net', under the user name 'booger', and a password of 'foobar'.
First, I need to add all this to the file /etc/ppp/pap-secrets
.
The format of an entry for our purposes, is:
USERNAME SERVERNAME PASSWORD
so I add the line:
booger glob foobar
to the file and save it. Note: I can use any name for the server I wish as long as I use the same name in the pppd arguments, as we'll see shortly. I have shortened it to 'glob'. This name is just used to locate the correct password.
Now, I need to set up my connection in kppp. The basics are the same
as any other connection, and I won't go into details here, except to say
that you probably want to make sure that the /etc/ppp/options,
is empty,
and you probably don't want any login script either. Now, in the settings
dialog, at the bottom, is the pppd arguments button. This brings up a dialog
similar to the one used for editing the login script. Here we enter valuesthat
will be sent to pppd as command line arguments, and in the case of multiple-value
arguments, we need to enter each value as a separate entry in the listbox,
in the correct order.
We can put any other arguments in here we want first. In addition to the default '-detach' and 'defaultroute', you might want to add 'lock'. Now we need to add arguments that pppd needs to handle PAP authentication. In this example I am going to add 'user', 'booger', 'remotename', 'glob', in that order. The user argument tells pppd what user name to look for in pap-secrets, and send to the server. The remotename is only used by pppd to match the entry in the pap-secrets file, and is not sent to the server, so once again, it can be anything I want as long as it is consistent with the entry in the pap-secrets file.
That's all there is to it. You should now be able to set up your own connection to a server with PAP authentication. CHAP should not be much different. See the Linux Network Adminstrators' Guide for chap-secrets file format and pppd arguments used. The rest should be gravy, but...your mileage, ah you know the rest.
By default Kppp makes use of the following files and directories. The location of some of those can be changed at compile time.
$(KDEDIR)/bin/kppp
$(KDEDIR)/docs/HTML/kppp/*
$(KDEDIR)/lib/kppp
$(KDEDIR)/lib/kppp/Rules
$(HOMEDIR)/.kde/kppp
$(HOMEDIR)/.kde/kppp/Costs
$(HOMEDIR)/.kde/kppp/Rules/*.rst
$(HOMEDIR)/.kde/kppp/Log/*
$(HOMEDIR)/.kde/kppp/kpppdata
$(HOMEDIR)/.kde/config/kppprc (not used)