darkk/redsocks

1593092444.851314 err base.c:396 base_init(...) getpwnam(redsocks): Success

gounthar opened this issue · 2 comments

Hi there,

I have already used that fantastic tool on several machines without any issue, but today, on another machine running CentOS Linux release 7.8.2003 (Core), I experienced this error after compiling on the machine:
1593092444.851314 err base.c:396 base_init(...) getpwnam(redsocks): Success
Is that really an error? I can't see anything in system logs. I would love to give/have more info, but I have not yet found how to get more.
Netstat tells me it's not bound on the 12345 port:

 netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:1935            0.0.0.0:*               LISTEN      7300/nginx: master
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      7300/nginx: master
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      17235/sshd
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      25540/master
tcp6       0      0 :::22                   :::*                    LISTEN      17235/sshd
tcp6       0      0 ::1:25                  :::*                    LISTEN      25540/master
udp        0      0 0.0.0.0:68              0.0.0.0:*                           831/dhclient

Here is the strace log: log.

base {
        log_debug = on;
        log_info = on;
        log = "syslog:daemon";
        daemon = on;
        user = redsocks;
        group = redsocks;
        redirector = iptables;
}
redsocks {
        local_ip = 127.0.0.1;
        local_port = 12345;
        ip = 192.168.0.217;
        port = 3128;
        type = http-connect;
}
redudp {
        local_ip = 127.0.0.1;
        local_port = 10053;
        dest_ip = 192.0.2.2;
        dest_port = 53;
        udp_timeout = 30;
        udp_timeout_stream = 180;
}

dnstc {
        local_ip = 127.0.0.1;
        local_port = 5300;
}
```

hello gounthar,

I had the same error.
this error occurs because you have not yet created a user "redsocks". This is namely defined in the redsocks.conf. The /etc/passwd need something like: "redsocks:x:UID:GUID::/var/run/redsocks:/usr/sbin/nologin". You need also a Group named redsocks.
If you compiled redsocks or install it with dpkg, no user is created.

That worked, thanks a lot.