1. Make sure Tor is already installed in your system.
2. Type
sudo vim /etc/tor/torrc then find the section that has "SocksPort 9050" and remove the comments for both of them including the line below it (Bind).3. For the second line instead of 0.0.0.0 or 192 blabla or 127 change it to your VPS IP.
4. Save it by typing : then type "wq!" then restart Tor by using this command
sudo systemctl restart tor5. Magic! You can now connect to it remotely.