I try to activate username and password authentication for my tor installation using the fields SOCKS5Username and SOCKS5Password in the /etc/tor/torsocks.conf file. I have restarted the service after config change and checked if it really restarted. But tor is still available without username and password on my machine.
I have installed Tor from EPEL repo. More information about Installation:
Installed Packages
Name : tor
Arch : x86_64
Version : 0.2.7.6
Release : 5.el7
Current OS
CentOS Linux release 7.2.1511 (Core)
Tor Configuration
[root@torproxy ~]# cat /etc/tor/torsocks.conf | grep -v "^#"
TorAddress curl 10.0.0.43
TorPort 18009
OnionAddrRange 127.42.42.0/24
SOCKS5Username test
SOCKS5Password 1234
[root@torproxy ~]# cat /etc/tor/torrc | grep -v "^#"
ControlSocket /run/tor/control
ControlSocketsGroupWritable 1
CookieAuthentication 1
CookieAuthFile /run/tor/control.authcookie
CookieAuthFileGroupReadable 1
SOCKSPort 10.0.0.43:18009
SOCKSPolicy accept *