Error messages indicating you have this problem are "Permission denied", "IOError when attempting to open socket ( constructor ), shutting down! java.net.BindException: Operation not permitted" or "java.net.SocketException: No such file or directory".
I recently developed my own smtp listener (converting e-mail to text/sms messages) and rather run the service as it's own user. Here's how (for port 25):
Install authbind (allows a program which does not or should not run as root to bind to low-numbered ports in a controlled way):
apt-get install authbind
Configure authbind (replace user with your user):
touch /etc/authbind/byport/25
chown user:user /etc/authbind/byport/25
chmod 755 /etc/authbind/byport/25
Start the service (simple test):
authbind nc -l -p 25 -e "/usr/bin/uptime"
authbind --deep /bin/bash -c "/usr/bin/java -Djava.net.preferIPv4Stack=true com.cent.texter.TexterServer"
This comment has been removed by a blog administrator.
ReplyDelete