Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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:

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


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.