Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Under "System" > "Preferences" > "Network Connections" I can create PPTP VPNs. This works when I am at a GUI, I can click the network connections icon in the top right, and select a VPN from the list and connect to it.

Is it possible to connect to these PPTP sessions via the terminal if I only have SSH access, using these predefined sessions, so I don't have to type all the details in again?

share|improve this question

3 Answers 3

try to configure pppd, this is an example. i believe you understand that your configuration file can differ.

share|improve this answer
up vote 1 down vote accepted

So it turns out this is a duplicate of another question which I couldn't previously find;

Connect/disconnect from VPN from the command line

I would like to add though, to install nmcli on my 10.04 machine I had to;

sudo add-apt-repository ppa:network-manager/trunk  
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install network-manager
share|improve this answer

use the 'pppd' to accomplish it:

sudo pppd nodetach defaultroute replacedefaultroute persist password mypassword file myvpn

replace "mypassword" with your pptp account's password. the "myvpn" is a config file, format as:

linkname myvpn 
ipparam myvpn 
pty "pptp server_address --nolaunchpppd " 
name myaccount 
usepeerdns 
require-mppe 
refuse-eap noauth

# adopt defaults from the pptp-linux package 
file /etc/ppp/options.pptp

this config file format is mentioned in here:https://help.ubuntu.com/community/VPNClient

And, "nodetach", or "defaultroute" are options for pppd, been described here:http://manpages.ubuntu.com/manpages/hardy/man8/pppd.8.html

I have use this method in java to setup a pptp client vpn connection, yes, it works.

The pid file, is in /var/run/ppp-xxx.pid, the "xxx" is your linkname that in your config file. You can read the pid of pppd from this pid file send a signal to the pppd, e.g "sudo kill -s SIGTERM pid_of_pppd", to shutdown the pppd.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.