Setup a SOCKS5 proxy server with five commands.

Here I describe how to create a SOCKS5 proxy server with authentification on Debian 9 (Stretch) using Dante in five steps.

1. Login into your VPS as root and install dante-server package:
root@server# apt-get update
root@server# apt-get install dante-server

2. Open /etc/danted.conf, delete all strings and copy-paste this (only replace with your server IP address):
logoutput: stderr
internal: port = 1080

socksmethod: username
user.privileged: root
user.unprivileged: nobody
user.libwrap: nobody

client pass {
    from: 0/0 to: 0/0
    log: error

socks pass {
    from: 0/0 to: 0/0
    log: error

3. Restart danted:
root@server# /etc/init.d/danted restart

4. Add user (replace USERNAME with a desirable username):
root@server# useradd --shell /usr/sbin/nologin USERNAME

5. Set password:
root@server# passwd USERNAME

6. (Optional) Test proxy with curl on your local machine (replace USERNAME, PASSWORD and with values used above):
user@local-pc$ curl -x socks5://

You must get a "" response (your server IP address).