Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.


I am using telnet because of a barcode reader. It is pretty old before 2000 i think and it seems that it supports only telnet via wifi connection. However how can i restrict telnet access to only this device ip and to only one user? How can i force that only a terminal application is executed and when it is closed no one can make any change to the system?

share|improve this question

2 Answers 2

I don't use telnet for a long time but the following should work:

Edit /etc/hosts.allow and add:

telnetd: allowed_IP

About restricting the telnet login ability to a single user check the following answer: http://serverfault.com/questions/36322/how-can-i-use-pam-to-restrict-telnet-login-by-user

You can define the user shell so that a specific application is invoked during login, but please note that depending on the application or shell profile there could be workarounds to manually escape to a full shells.

share|improve this answer

You could manage all of this with iptables. As long as your default INPUT rules were not allow everything this would work.

/sbin/iptables -A INPUT -p tcp --dport 23 -s IP_ADDRESS -j ACCEPT
/sbin/iptables -A INPUT -p tcp --syn --dport 23 -m connlimit --connlimit-above 1 -j REJECT
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.