Making a SSH VPNSystemwide proxy settings in ubuntuSetting-up SSH-tunnel for VPN?How to add a private IP address?VPN for SSH, Internet for all the restCisco VPN Connection only for ssh?How to redirect all internet traffic to SSH tunnel?SSH to Server that is connected to VPNSSH and VPN Cisco connection working on one laptop but not on another. Both laptops using Ubuntu 14.04. Where is the difference?SSH into Virtual Private Server connected to VPNSSH through VPN ChromebookUsing SSH when behind VPNHow to make a killswitch for OpenVPN client running on a server that allows SSH connections into the server?How to use VPN in a similar manner as SSH tunes?
Which country has more?
Is divide-by-zero a security vulnerability?
What do you call someone who likes to pick fights?
Was it really inappropriate to write a pull request for the company I interviewed with?
What would be the most expensive material to an intergalactic society?
Is it appropriate to ask a former professor to order a book for me through an inter-library loan?
I am the person who abides by rules, but breaks the rules. Who am I?
Under what conditions can the right to be silence be revoked in the USA?
When an outsider describes family relationships, which point of view are they using?
How can a demon take control of a human body during REM sleep?
Is there a logarithm base for which the logarithm becomes an identity function?
What is Tony Stark injecting into himself in Iron Man 3?
Does an unused member variable take up memory?
Are small insurances worth it?
Are all players supposed to be able to see each others' character sheets?
Is it possible to clone a polymorphic object without manually adding overridden clone method into each derived class in C++?
Has a sovereign Communist government ever run, and conceded loss, on a fair election?
Boss Telling direct supervisor I snitched
If sound is a longitudinal wave, why can we hear it if our ears aren't aligned with the propagation direction?
Called into a meeting and told we are being made redundant (laid off) and "not to share outside". Can I tell my partner?
PTIJ: Sport in the Torah
Help! My Character is too much for her story!
How do we create new idioms and use them in a novel?
What should I do when a paper is published similar to my PhD thesis without citation?
Making a SSH VPN
Systemwide proxy settings in ubuntuSetting-up SSH-tunnel for VPN?How to add a private IP address?VPN for SSH, Internet for all the restCisco VPN Connection only for ssh?How to redirect all internet traffic to SSH tunnel?SSH to Server that is connected to VPNSSH and VPN Cisco connection working on one laptop but not on another. Both laptops using Ubuntu 14.04. Where is the difference?SSH into Virtual Private Server connected to VPNSSH through VPN ChromebookUsing SSH when behind VPNHow to make a killswitch for OpenVPN client running on a server that allows SSH connections into the server?How to use VPN in a similar manner as SSH tunes?
So by using ssh you will connect to a server by typing in ssh User@PrivateIP how would it be possible to turn that code into a piece of code that works like a VPN (so searching for example google from a different geolocation). FYI: By connecting I mean that you connect to a computer of your own and not a supplied VPN server.
command-line ssh vpn proxy
add a comment |
So by using ssh you will connect to a server by typing in ssh User@PrivateIP how would it be possible to turn that code into a piece of code that works like a VPN (so searching for example google from a different geolocation). FYI: By connecting I mean that you connect to a computer of your own and not a supplied VPN server.
command-line ssh vpn proxy
1
Do you mean you want to run a socks proxy server at your home desktop and connect to it from your laptop when traveling?
– user68186
Jan 29 at 12:58
You are looking for SSH Tunneling. Otherwise you can setup VPN via ordinary VPN server.
– kukulo
Jan 29 at 13:39
I don't know if you're looking for something like this: How to build your own VPN ...
– glenn jackman
Jan 29 at 18:30
3
Possible duplicate of Setting up SSH tunnel for VPN?
– karel
Feb 1 at 15:02
3
@Reviewers: Let's reopen this question and close it as a duplicate of Setting up SSH tunnel for VPN?
– pa4080
yesterday
add a comment |
So by using ssh you will connect to a server by typing in ssh User@PrivateIP how would it be possible to turn that code into a piece of code that works like a VPN (so searching for example google from a different geolocation). FYI: By connecting I mean that you connect to a computer of your own and not a supplied VPN server.
command-line ssh vpn proxy
So by using ssh you will connect to a server by typing in ssh User@PrivateIP how would it be possible to turn that code into a piece of code that works like a VPN (so searching for example google from a different geolocation). FYI: By connecting I mean that you connect to a computer of your own and not a supplied VPN server.
command-line ssh vpn proxy
command-line ssh vpn proxy
edited Jan 30 at 9:26
pa4080
14.4k52670
14.4k52670
asked Jan 29 at 12:49
ijndkgeoijndkgeo
153
153
1
Do you mean you want to run a socks proxy server at your home desktop and connect to it from your laptop when traveling?
– user68186
Jan 29 at 12:58
You are looking for SSH Tunneling. Otherwise you can setup VPN via ordinary VPN server.
– kukulo
Jan 29 at 13:39
I don't know if you're looking for something like this: How to build your own VPN ...
– glenn jackman
Jan 29 at 18:30
3
Possible duplicate of Setting up SSH tunnel for VPN?
– karel
Feb 1 at 15:02
3
@Reviewers: Let's reopen this question and close it as a duplicate of Setting up SSH tunnel for VPN?
– pa4080
yesterday
add a comment |
1
Do you mean you want to run a socks proxy server at your home desktop and connect to it from your laptop when traveling?
– user68186
Jan 29 at 12:58
You are looking for SSH Tunneling. Otherwise you can setup VPN via ordinary VPN server.
– kukulo
Jan 29 at 13:39
I don't know if you're looking for something like this: How to build your own VPN ...
– glenn jackman
Jan 29 at 18:30
3
Possible duplicate of Setting up SSH tunnel for VPN?
– karel
Feb 1 at 15:02
3
@Reviewers: Let's reopen this question and close it as a duplicate of Setting up SSH tunnel for VPN?
– pa4080
yesterday
1
1
Do you mean you want to run a socks proxy server at your home desktop and connect to it from your laptop when traveling?
– user68186
Jan 29 at 12:58
Do you mean you want to run a socks proxy server at your home desktop and connect to it from your laptop when traveling?
– user68186
Jan 29 at 12:58
You are looking for SSH Tunneling. Otherwise you can setup VPN via ordinary VPN server.
– kukulo
Jan 29 at 13:39
You are looking for SSH Tunneling. Otherwise you can setup VPN via ordinary VPN server.
– kukulo
Jan 29 at 13:39
I don't know if you're looking for something like this: How to build your own VPN ...
– glenn jackman
Jan 29 at 18:30
I don't know if you're looking for something like this: How to build your own VPN ...
– glenn jackman
Jan 29 at 18:30
3
3
Possible duplicate of Setting up SSH tunnel for VPN?
– karel
Feb 1 at 15:02
Possible duplicate of Setting up SSH tunnel for VPN?
– karel
Feb 1 at 15:02
3
3
@Reviewers: Let's reopen this question and close it as a duplicate of Setting up SSH tunnel for VPN?
– pa4080
yesterday
@Reviewers: Let's reopen this question and close it as a duplicate of Setting up SSH tunnel for VPN?
– pa4080
yesterday
add a comment |
1 Answer
1
active
oldest
votes
It's not exactly VPN, but could be enough in the most cases. You can create ssh connection with dynamic port forwarding to create socks proxy:
ssh -D 9050 user@sshserver -fTNC
-D [bind_address:]portSpecifies a local “dynamic” application-level port forwarding... Whenever a connection is made to this port, the connection is forwarded over the secure channel, and the application protocol is then used to determine where to connect to from the remote machine. Currently the SOCKS4 and SOCKS5 protocols are supported... read more atman ssh.The options
-fTNCwill enable the compression and will push the connection in the background.Optionally use
autosshinstead ofssh.In addition, you can create
crontabentry as this:@reboot autossh -D 9050 user@sshserver -fTNC
The rest you need to do is to tell your applications to use localhost:9050 as socks proxy. Here are few references dedicated to this task:
Systemwide proxy settings in ubuntu or How to on Ubuntu 18.04
Set Ubuntu System Proxy Settings without Restart from command-line
How To Route Web Traffic Securely Without a VPN Using a SOCKS Tunnel
Setting up Proxy in Ubuntu
For any other special requirements probably
iptablesrules can be applied.
Another solution that is more close to VPN is sshuttle, which works over ssh too. Here is its overview:
sshuttle: where transparent proxy meets VPN meets ssh
As far as I know, sshuttle is the only program that solves the following common case:
- Your client machine (or router) is Linux, FreeBSD, or MacOS.
- You have access to a remote network via ssh.
- You don't necessarily have admin access on the remote network.
- The remote network has no VPN, or only stupid/complex VPN protocols (IPsec, PPTP, etc). Or maybe you are the admin and you just got
frustrated with the awful state of VPN tools.
- You don't want to create an ssh port forward for every single host/port on the remote network.
- You hate openssh's port forwarding because it's randomly slow and/or stupid.
- You can't use openssh's PermitTunnel feature because it's disabled by default on openssh servers; plus it does TCP-over-TCP, which has
terrible performance (see below).
It is available in Ubuntu repository, so you can install it and start your examination by the command:
sudo apt install sshuttle
It is also possible to install into a virtualenv as a non-root user. Once it is installed you can use:
sshuttle --dns -r user@sshserver 0.0.0.0/0
This command will forward all traffic including DNS queries will be proxied through the DNS server of the server you are connect to.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1113801%2fmaking-a-ssh-vpn%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
It's not exactly VPN, but could be enough in the most cases. You can create ssh connection with dynamic port forwarding to create socks proxy:
ssh -D 9050 user@sshserver -fTNC
-D [bind_address:]portSpecifies a local “dynamic” application-level port forwarding... Whenever a connection is made to this port, the connection is forwarded over the secure channel, and the application protocol is then used to determine where to connect to from the remote machine. Currently the SOCKS4 and SOCKS5 protocols are supported... read more atman ssh.The options
-fTNCwill enable the compression and will push the connection in the background.Optionally use
autosshinstead ofssh.In addition, you can create
crontabentry as this:@reboot autossh -D 9050 user@sshserver -fTNC
The rest you need to do is to tell your applications to use localhost:9050 as socks proxy. Here are few references dedicated to this task:
Systemwide proxy settings in ubuntu or How to on Ubuntu 18.04
Set Ubuntu System Proxy Settings without Restart from command-line
How To Route Web Traffic Securely Without a VPN Using a SOCKS Tunnel
Setting up Proxy in Ubuntu
For any other special requirements probably
iptablesrules can be applied.
Another solution that is more close to VPN is sshuttle, which works over ssh too. Here is its overview:
sshuttle: where transparent proxy meets VPN meets ssh
As far as I know, sshuttle is the only program that solves the following common case:
- Your client machine (or router) is Linux, FreeBSD, or MacOS.
- You have access to a remote network via ssh.
- You don't necessarily have admin access on the remote network.
- The remote network has no VPN, or only stupid/complex VPN protocols (IPsec, PPTP, etc). Or maybe you are the admin and you just got
frustrated with the awful state of VPN tools.
- You don't want to create an ssh port forward for every single host/port on the remote network.
- You hate openssh's port forwarding because it's randomly slow and/or stupid.
- You can't use openssh's PermitTunnel feature because it's disabled by default on openssh servers; plus it does TCP-over-TCP, which has
terrible performance (see below).
It is available in Ubuntu repository, so you can install it and start your examination by the command:
sudo apt install sshuttle
It is also possible to install into a virtualenv as a non-root user. Once it is installed you can use:
sshuttle --dns -r user@sshserver 0.0.0.0/0
This command will forward all traffic including DNS queries will be proxied through the DNS server of the server you are connect to.
add a comment |
It's not exactly VPN, but could be enough in the most cases. You can create ssh connection with dynamic port forwarding to create socks proxy:
ssh -D 9050 user@sshserver -fTNC
-D [bind_address:]portSpecifies a local “dynamic” application-level port forwarding... Whenever a connection is made to this port, the connection is forwarded over the secure channel, and the application protocol is then used to determine where to connect to from the remote machine. Currently the SOCKS4 and SOCKS5 protocols are supported... read more atman ssh.The options
-fTNCwill enable the compression and will push the connection in the background.Optionally use
autosshinstead ofssh.In addition, you can create
crontabentry as this:@reboot autossh -D 9050 user@sshserver -fTNC
The rest you need to do is to tell your applications to use localhost:9050 as socks proxy. Here are few references dedicated to this task:
Systemwide proxy settings in ubuntu or How to on Ubuntu 18.04
Set Ubuntu System Proxy Settings without Restart from command-line
How To Route Web Traffic Securely Without a VPN Using a SOCKS Tunnel
Setting up Proxy in Ubuntu
For any other special requirements probably
iptablesrules can be applied.
Another solution that is more close to VPN is sshuttle, which works over ssh too. Here is its overview:
sshuttle: where transparent proxy meets VPN meets ssh
As far as I know, sshuttle is the only program that solves the following common case:
- Your client machine (or router) is Linux, FreeBSD, or MacOS.
- You have access to a remote network via ssh.
- You don't necessarily have admin access on the remote network.
- The remote network has no VPN, or only stupid/complex VPN protocols (IPsec, PPTP, etc). Or maybe you are the admin and you just got
frustrated with the awful state of VPN tools.
- You don't want to create an ssh port forward for every single host/port on the remote network.
- You hate openssh's port forwarding because it's randomly slow and/or stupid.
- You can't use openssh's PermitTunnel feature because it's disabled by default on openssh servers; plus it does TCP-over-TCP, which has
terrible performance (see below).
It is available in Ubuntu repository, so you can install it and start your examination by the command:
sudo apt install sshuttle
It is also possible to install into a virtualenv as a non-root user. Once it is installed you can use:
sshuttle --dns -r user@sshserver 0.0.0.0/0
This command will forward all traffic including DNS queries will be proxied through the DNS server of the server you are connect to.
add a comment |
It's not exactly VPN, but could be enough in the most cases. You can create ssh connection with dynamic port forwarding to create socks proxy:
ssh -D 9050 user@sshserver -fTNC
-D [bind_address:]portSpecifies a local “dynamic” application-level port forwarding... Whenever a connection is made to this port, the connection is forwarded over the secure channel, and the application protocol is then used to determine where to connect to from the remote machine. Currently the SOCKS4 and SOCKS5 protocols are supported... read more atman ssh.The options
-fTNCwill enable the compression and will push the connection in the background.Optionally use
autosshinstead ofssh.In addition, you can create
crontabentry as this:@reboot autossh -D 9050 user@sshserver -fTNC
The rest you need to do is to tell your applications to use localhost:9050 as socks proxy. Here are few references dedicated to this task:
Systemwide proxy settings in ubuntu or How to on Ubuntu 18.04
Set Ubuntu System Proxy Settings without Restart from command-line
How To Route Web Traffic Securely Without a VPN Using a SOCKS Tunnel
Setting up Proxy in Ubuntu
For any other special requirements probably
iptablesrules can be applied.
Another solution that is more close to VPN is sshuttle, which works over ssh too. Here is its overview:
sshuttle: where transparent proxy meets VPN meets ssh
As far as I know, sshuttle is the only program that solves the following common case:
- Your client machine (or router) is Linux, FreeBSD, or MacOS.
- You have access to a remote network via ssh.
- You don't necessarily have admin access on the remote network.
- The remote network has no VPN, or only stupid/complex VPN protocols (IPsec, PPTP, etc). Or maybe you are the admin and you just got
frustrated with the awful state of VPN tools.
- You don't want to create an ssh port forward for every single host/port on the remote network.
- You hate openssh's port forwarding because it's randomly slow and/or stupid.
- You can't use openssh's PermitTunnel feature because it's disabled by default on openssh servers; plus it does TCP-over-TCP, which has
terrible performance (see below).
It is available in Ubuntu repository, so you can install it and start your examination by the command:
sudo apt install sshuttle
It is also possible to install into a virtualenv as a non-root user. Once it is installed you can use:
sshuttle --dns -r user@sshserver 0.0.0.0/0
This command will forward all traffic including DNS queries will be proxied through the DNS server of the server you are connect to.
It's not exactly VPN, but could be enough in the most cases. You can create ssh connection with dynamic port forwarding to create socks proxy:
ssh -D 9050 user@sshserver -fTNC
-D [bind_address:]portSpecifies a local “dynamic” application-level port forwarding... Whenever a connection is made to this port, the connection is forwarded over the secure channel, and the application protocol is then used to determine where to connect to from the remote machine. Currently the SOCKS4 and SOCKS5 protocols are supported... read more atman ssh.The options
-fTNCwill enable the compression and will push the connection in the background.Optionally use
autosshinstead ofssh.In addition, you can create
crontabentry as this:@reboot autossh -D 9050 user@sshserver -fTNC
The rest you need to do is to tell your applications to use localhost:9050 as socks proxy. Here are few references dedicated to this task:
Systemwide proxy settings in ubuntu or How to on Ubuntu 18.04
Set Ubuntu System Proxy Settings without Restart from command-line
How To Route Web Traffic Securely Without a VPN Using a SOCKS Tunnel
Setting up Proxy in Ubuntu
For any other special requirements probably
iptablesrules can be applied.
Another solution that is more close to VPN is sshuttle, which works over ssh too. Here is its overview:
sshuttle: where transparent proxy meets VPN meets ssh
As far as I know, sshuttle is the only program that solves the following common case:
- Your client machine (or router) is Linux, FreeBSD, or MacOS.
- You have access to a remote network via ssh.
- You don't necessarily have admin access on the remote network.
- The remote network has no VPN, or only stupid/complex VPN protocols (IPsec, PPTP, etc). Or maybe you are the admin and you just got
frustrated with the awful state of VPN tools.
- You don't want to create an ssh port forward for every single host/port on the remote network.
- You hate openssh's port forwarding because it's randomly slow and/or stupid.
- You can't use openssh's PermitTunnel feature because it's disabled by default on openssh servers; plus it does TCP-over-TCP, which has
terrible performance (see below).
It is available in Ubuntu repository, so you can install it and start your examination by the command:
sudo apt install sshuttle
It is also possible to install into a virtualenv as a non-root user. Once it is installed you can use:
sshuttle --dns -r user@sshserver 0.0.0.0/0
This command will forward all traffic including DNS queries will be proxied through the DNS server of the server you are connect to.
edited yesterday
answered Jan 29 at 22:47
pa4080pa4080
14.4k52670
14.4k52670
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1113801%2fmaking-a-ssh-vpn%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Do you mean you want to run a socks proxy server at your home desktop and connect to it from your laptop when traveling?
– user68186
Jan 29 at 12:58
You are looking for SSH Tunneling. Otherwise you can setup VPN via ordinary VPN server.
– kukulo
Jan 29 at 13:39
I don't know if you're looking for something like this: How to build your own VPN ...
– glenn jackman
Jan 29 at 18:30
3
Possible duplicate of Setting up SSH tunnel for VPN?
– karel
Feb 1 at 15:02
3
@Reviewers: Let's reopen this question and close it as a duplicate of Setting up SSH tunnel for VPN?
– pa4080
yesterday