Old Q How do I setup an OpenVPN server without root privileges?
Is there a way to setup an OpenVPN server without root privileges? E.g. with configuration files in my home directory? If yes, how do I set it up?
I'm trying to SSH into a system and set up an OpenVPN server over there for personal use.
EDIT
Since it's apparent that OpenVPN needs root privileges, I am changing the question to routing my internet using SSH which I can easily set up.
sshuttle is a transparent proxy server that forwards over a SSH connection and sets up a proxy by running Python scripts on the remote server.
sshuttle
can be run under the following conditions:Install sshuttle from the Software Center or the Terminal:
The basic command for running sshuttle with routing all traffic is:
Upon the execution of the command, a
sudo
password prompt will appear and subsequently the password to SSH account. No other details will appear except for a short message and return to shell upon failure. For more status messages, runsshuttle
in verbose mode with the-v
flag.In this example all internet traffic except DNS is routed through the VPN.
-r
flag denotes the remote hostname and optional username and port that follows in the above example.0/0
is short for0.0.0.0/0
that represents the subnets to route over the VPN. The usage of0/0
routes all the traffic except DNS requests to the remote server. DNS tunelling is possible with the usage of-H
flag.Please read the man page (
man sshuttle
) for the details of options and modes under whichsshuttle
can run. For information about the concept and more examples, refer to the project page.You cannot setup OpenVPN without root privileges because certain operations requires it.
ifconfig
. Otherwise, no communication is possible between the server and clientDepending on your needs, other solutions are available. For browsing through your server, you may set up a SOCKS server.
SOCKS proxy
Setting up a SOCKS proxy is not difficult: it's built-in in OpenSSH. To enable the SOCKS server, run the next command in a terminal:
Replace 1234 by your preferred port. In your browser, you can enter
localhost
as host and1234
as port at SOCKS4/5 server.Below is an example in the Firefox browser:
localhost
as SOCKS Host1234
as port (the same port as specified in the SSH command)If you only want to tunnel your systems TCP traffic i recommend to use a programm called tun2socks. If you also want to tunnel UDP traffic you have to install udpgw on your server.
Here is an tutorial how to install and use this programms: http://board.nwrk.biz/viewtopic.php?id=3