But nmap (or some other program) doesn’t support proxy… so you need proxychains.
If you are on a Debian-based simply type
apt-get install proxychains
And add your proxy. If you want to learn the syntax, in the config file you can see some more examples.
I try to explain with a regex-like expression:
[http|socks4|socks5] ipaddress port username password
Be happy, Tor is configured by default!
It’s not all. Obviously proxychains is used primarily for proxy chaining.
How to configure it? Add more proxies to proxychain.conf !
Finally run your software, e.g.
proxychains nmap -T4 -A ipaddress