VPN and Remote-Desktop for GNU/Linux
To connect to my work's MS network, I needed to set up a VPN (Virtual Private Network) connection. This page details is the methods I use to connect to a Cisco 3000 VPN Concentrator.
Note: to connect using the VPN, the firewall may need to be disabled during the connect.
Cisco VPN Client
My work provided the Cisco VPN client software for me to use. Note that the below example is on Slackware Linux, for Redhat and several other distributions replace rc.d
with init.d
.
I unpacked and installed it:
tar -xzvf vpnclient-linux-3.7.3.A-k9.tar.gz cd vpnclient ./vpn_install /etc/rc.d/vpnclient_init start
To save time, I copied the .pcf file (used to store the connection details) from a windows machine (it's easy enough to set up if you don't have one):
cp clientname.pcf /etc/CiscoSystemsVPNClient/Profiles/
To connect:
vpnclient connect clientname
To set this up, so you don't have to be logged in as root to initiate the vpn client, you need to use...
sudo
To setup a command that only root could normally run, use visudo
;
Here is an example to allow the use of the VPN service:
Cmnd_Alias VPN=/etc/rc.d/vpnclient_init roqetman ALL=NOPASSWD: VPN
Now, the command can be run from user (roqetman) as:
sudo /etc/rc.d/vpnclient_init start
and to stop the VPN software:
sudo /etc/rc.d/vpnclient_init stop
Running vpnconnect
will however take over your terminal, so if you don't want to open another terminal or use screen
, you can push it into the background by typing ctrl-z
followed by bg
after the vpnconnect
line.
VPNC on Ubuntu
There are several ways to get the Cisco client to work on Ubuntu, but I find that the native vpnc
package works best.
To install it, type: sudo apt-get install vpnc
To convert the .pcf
file that my company provided, I did the following:
cd /usr/share/vpnc/ ./pcf2vpnc clientname.pcf > clientname.conf cp clientname.conf /etc/vpnc/
To connect, type: sudo vpnc clientname
If you want to setup the configuration file (in this case clientname.conf
) manually, you need to use this format:
IPSec gateway gateway.to.use IPSec ID groupname IPSec secret passwordforgroup Xauth username myusername Xauth password mypassword
You can also use interactive mode buy just typing vpnc
and it will ask you all of the above.
To disconnect from the VPN type: sudo vpnc-disconnect
Remote Desktop
Once I'd connected to my work's MS network, I needed to use my Windows XP pc there. In my opinion, the best way to do this is to use remote desktop...
I went to to LinuxPackages (you can get a lot of software specially packed for use on Slackware here).
Downloaded rdesktop
(the Linux remote desktop software)
as root:
installpkg rdesktop*
Usage: rdesktop -f IPAddress
(this opens the window to full the screen, toggle with ctrl-alt-enter
.
Ubuntu usually has this installed by default along with the GUI application to access it (just look for "Remote Desktop").
Notes
Use freeBSD? : See this document
Want to install the Cisco VPN Client on Ubuntu? : Take a look here for some advice.