0

I am getting the following error when trying to use telnet in RHEL 8 telnet: Command not found. I have installed telnet and telnet-server however strangely telnet is working when i am the root users but when I am on my normal user account it is telling me telnet command not found.

131> rpm -qa | grep telnet
dcap-tunnel-telnet-2.47.12-4.el8.x86_64
libtelnet-utils-0.23-1.el8.x86_64
telnet-0.17-73.el8_1.1.x86_64
libtelnet-devel-0.23-1.el8.x86_64
libtelnet-0.23-1.el8.x86_64
telnet-server-0.17-73.el8_1.1.x86_64

# when on user account see this error.
32> telnet
telnet: Command not found.
 
# when changing to root telnet is working
[root@localhost mastarke]# telnet
telnet>
5
  • What is the output of which telnet (as root)? Mar 19, 2021 at 20:59
  • it gives this /bin/telnet
    – Max Powers
    Mar 19, 2021 at 21:04
  • What if you run /bin/telnet?
    – jsbillings
    Mar 19, 2021 at 21:15
  • initially did not work but changed permissions and it works. But still not sure why i am having to do all these workaround steps.
    – Max Powers
    Mar 19, 2021 at 21:21
  • What were the permissions and what are they now? I think it's probably more likely that you're tried to run telnet earlier (before you installed it) and your session shell had cached the "not found" state Mar 19, 2021 at 21:57

1 Answer 1

2

The simplest explanation would be that the telnet binary is not in the PATH. On some systems, users' path do not include /sbin and /usr/sbin, but root's PATH does. If telnet is in one of those two directories, you'd get a "command not found" error as user.

Another possibility is that the binary has not execute permissions for anyone except root, but in that case, the error should have been "Permission denied".

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .