# How to create a socks proxy tunnel with ssh

**URL:** <https://linux-tips.com/t/how-to-create-a-socks-proxy-tunnel-with-ssh/365>\
**Category:** Network\
**Created:** [July 13, 2016, 11:25am UTC](https://linux-tips.com/t/how-to-create-a-socks-proxy-tunnel-with-ssh/365 "2016-07-13T11:25:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![redsector](https://linux-tips.com/user_avatar/linux-tips.com/redsector/32/71_2.png) [@redsector](https://linux-tips.com/u/redsector)\
**Post date:** [July 13, 2016, 11:25am UTC](https://linux-tips.com/t/how-to-create-a-socks-proxy-tunnel-with-ssh/365/1 "2016-07-13T11:25:41Z")

</div>

If you’re in a network which is insecure and you can not use any VPN methods but you have a remote ssh access, it is possible to create a SOCKS5 proxy tunnel with ssh.

No special client needed to create socks tunnel over ssh, just use following command:

```auto
$ ssh -D 1080 -N user@server

```

- `-D` option used to select listening port. It must be \> 1023 to bind as a normal user. **1080** is default port for normal socks server, you can use anything you want as port number
- `-N` option tells ssh that we don’t send any command once the tunnel setup completed

You can also use following extra parameters:

- `-C` option activates ssh compression feature on tunnel
- `-f` option forks the process and tunnel create command runs in background
- `-q` option used for running in quiet mode

After tunnel setup completed, you need to change proxy settings of clients. In Linux, most of the clients takes proxy settings from `network-manager`. You can change proxy settings like that:

![](https://linux-tips.com/uploads/default/original/1X/10cb49282d32d7a9b4daf3e8f1996fa6509ee321.png)

Now you can use your browser for safe surfing.
