CentOS 7 enabling Telnet



  • OK so still dealing with an issue here (Yealink Device management Platform). I have telnet installed and enabled and running.

    0_1528378610549_putty_2018-06-07_08-23-10.png

    I have firewall-cmd configured and loaded.

    0_1528378573637_putty_2018-06-07_08-25-28.png

    From Windows however I am unable to connect to the server using telnet (yes the client is installed).

    0_1528374535481_cmd_2018-06-07_08-28-48.png

    What else am I missing here?



  • I just figured it out, it's using the default port. 23 rather than the port I thought I added correctly.



  • Try to disable SELinux with the command "setenforce 0"



  • @iroal said in CentOS 7 enabling Telnet:

    Try to disable SELinux with the command "setenforce 0"

    That doesn't correct the issue either.



  • @dustinb3403 said in CentOS 7 enabling Telnet:

    I just figured it out, it's using the default port. 23 rather than the port I thought I added correctly.

    What if you create an IPTable forwarding from that 9090 port to the internal port 23? Does that work?



  • @dbeato said in CentOS 7 enabling Telnet:

    @dustinb3403 said in CentOS 7 enabling Telnet:

    I just figured it out, it's using the default port. 23 rather than the port I thought I added correctly.

    What if you create an IPTable forwarding from that 9090 port to the internal port 23? Does that work?

    How would I do that?



  • @dustinb3403 said in CentOS 7 enabling Telnet:

    @dbeato said in CentOS 7 enabling Telnet:

    @dustinb3403 said in CentOS 7 enabling Telnet:

    I just figured it out, it's using the default port. 23 rather than the port I thought I added correctly.

    What if you create an IPTable forwarding from that 9090 port to the internal port 23? Does that work?

    How would I do that?

    Actually, something along this lines might be good:
    http://sharadchhetri.com/2014/12/08/change-telnet-server-port-number-centos-7-rhel-7/



  • @dbeato I'm already reading it, but systemd fails to restart the service with

     systemctl status telnet.socket
    ā— telnet.socket - Telnet Server Activation Socket
       Loaded: loaded (/usr/lib/systemd/system/telnet.socket; enabled; vendor preset: disabled)
       Active: failed (Result: resources) since Thu 2018-06-07 08:35:37 EDT; 14min ago
    	 Docs: man:telnetd(8)
       Listen: [::]:9090 (Stream)
     Accepted: 1; Connected: 0
    
    Jun 07 08:37:31 server systemd[1]: Starting Telnet Server Activation Socket.
    Jun 07 08:37:51 server systemd[1]: telnet.socket failed to listen on sockets: Permission denied
    Jun 07 08:37:51 server systemd[1]: Failed to listen on Telnet Server Activation Socket.
    Jun 07 08:37:51 server systemd[1]: Starting Telnet Server Activation Socket.
    Jun 07 08:40:15 server systemd[1]: telnet.socket failed to listen on sockets: Permission denied
    Jun 07 08:40:15 server systemd[1]: Failed to listen on Telnet Server Activation Socket.
    Jun 07 08:40:15 server systemd[1]: Starting Telnet Server Activation Socket.
    Jun 07 08:49:31 server systemd[1]: telnet.socket failed to listen on sockets: Permission denied
    Jun 07 08:49:31 server systemd[1]: Failed to listen on Telnet Server Activation Socket.
    Jun 07 08:49:31 server systemd[1]: Starting Telnet Server Activation Socket.


  • @dustinb3403 said in CentOS 7 enabling Telnet:

    @dbeato said in CentOS 7 enabling Telnet:

    @dustinb3403 said in CentOS 7 enabling Telnet:

    I just figured it out, it's using the default port. 23 rather than the port I thought I added correctly.

    What if you create an IPTable forwarding from that 9090 port to the internal port 23? Does that work?

    How would I do that?

    For the firewall rules this is what I would use:

    firewall-cmd --zone=public --add-port=9009/tcp --permanent
    firewall-cmd --reload
    semanage port -a -t telnetd_port_t -p tcp 9099
    

    Also are you modifying the following file?
    /usr/lib/systemd/system/telnet.socket



  • and the journalctl logs has

    -- Unit telnet.socket has begun starting up.
    Jun 07 08:50:48 server polkitd[713]: Unregistered Authentication Agent for unix-process:3613:205717 (system bus name :1.48, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.
    Jun 07 08:57:21 server firewalld[743]: WARNING: ALREADY_ENABLED: 9090:tcp
    Jun 07 08:58:16 server polkitd[713]: Registered Authentication Agent for unix-process:3803:250497 (system bus name :1.53 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/
    Jun 07 08:58:16 server polkitd[713]: Unregistered Authentication Agent for unix-process:3803:250497 (system bus name :1.53, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.
    Jun 07 08:59:03 server polkitd[713]: Registered Authentication Agent for unix-process:3820:255214 (system bus name :1.54 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/
    Jun 07 08:59:03 server systemd[1]: Reloading.
    Jun 07 08:59:04 server polkitd[713]: Unregistered Authentication Agent for unix-process:3820:255214 (system bus name :1.54, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.
    Jun 07 08:59:11 server polkitd[713]: Registered Authentication Agent for unix-process:3840:255990 (system bus name :1.55 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/
    Jun 07 08:59:11 server systemd[1]: telnet.socket failed to listen on sockets: Permission denied
    Jun 07 08:59:11 server systemd[1]: Failed to listen on Telnet Server Activation Socket.


  • @dbeato said in CentOS 7 enabling Telnet:

    @dustinb3403 said in CentOS 7 enabling Telnet:

    @dbeato said in CentOS 7 enabling Telnet:

    @dustinb3403 said in CentOS 7 enabling Telnet:

    I just figured it out, it's using the default port. 23 rather than the port I thought I added correctly.

    What if you create an IPTable forwarding from that 9090 port to the internal port 23? Does that work?

    How would I do that?

    For the firewall rules this is what I would use:

    firewall-cmd --zone=public --add-port=9009/tcp --permanent
    firewall-cmd --reload
    semanage port -a -t telnetd_port_t -p tcp 9099
    

    Also are you modifying the following file?
    /usr/lib/systemd/system/telnet.socket

    Yes I've done all of this.



  • @dustinb3403 said in CentOS 7 enabling Telnet:

    @dbeato said in CentOS 7 enabling Telnet:

    @dustinb3403 said in CentOS 7 enabling Telnet:

    @dbeato said in CentOS 7 enabling Telnet:

    @dustinb3403 said in CentOS 7 enabling Telnet:

    I just figured it out, it's using the default port. 23 rather than the port I thought I added correctly.

    What if you create an IPTable forwarding from that 9090 port to the internal port 23? Does that work?

    How would I do that?

    For the firewall rules this is what I would use:

    firewall-cmd --zone=public --add-port=9009/tcp --permanent
    firewall-cmd --reload
    semanage port -a -t telnetd_port_t -p tcp 9099
    

    Also are you modifying the following file?
    /usr/lib/systemd/system/telnet.socket

    Yes I've done all of this.

    Interesting, I am not sure then.



  • @dbeato I've even modified the predefined service at /usr/lib/firewalld/services/telnet.xml to use port 9090 and the service still fails to load.



  • And I got the port forwarding to work.

    firewall-cmd --zone=public --add-forward-port=port=9090:proto=tcp:toport=23

    I can now telnet to my server on port 9090 (which forward to 23).



  • @dustinb3403 said in CentOS 7 enabling Telnet:

    And I got the port forwarding to work.

    firewall-cmd --zone=public --add-forward-port=port=9090:proto=tcp:toport=23

    I can now telnet to my server on port 9090 (which forward to 23).

    Nice!