Find the answer to your Linux question:
Results 1 to 5 of 5
Hello, I have been searching the past two days on how to solve my "connection refused" message that I am receiving in the linux terminal when using command "telnet machine.domain.com" ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2011
    Posts
    2

    Telnet - Connection Refused in Linux, works in Windows PuTTY


    Hello,

    I have been searching the past two days on how to solve my "connection refused" message that I am receiving in the linux terminal when using command "telnet machine.domain.com"

    The majority of solutions say telnet is disabled on the server, but this cannot be as I can successfully telnet in using PuTTY on a windows laptop.

    What's going wrong in CentOS (v6)? Any suggestions would be greatly appreciated!

    Matt.

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    The telnet server package is either not installed on your CentOS box or it is not enabled.

    # install it
    Code:
    yum install telnet-server
    # enable it
    Code:
    chkconfig telnet on
    # start it (via xinetd package)
    Code:
    service xinetd start
    Note, everybody is right, you should not be running telnet for security reasons (passwords passed in plain text). Use SSH instead. You can use it via Windows / Linux just fine.

    It works on your Windows box b/c you have the Telnet service enable and running (which you shouldn't).

  3. #3
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,444
    Just a hunch:
    You are aware, that putty uses ssh by default and not telnet?

    So I guess, you connected to the sshd daemon of that centos box.
    You must always face the curtain with a bow.

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Jul 2011
    Posts
    2
    Thank you for the suggestions.

    I tried atreyu's commands to no avail. They were successfully called, but "connection refused" still occurs when attempting to telnet.

    In PuTTY I definitely selected telnet, ssh does not work with this box.

    I understand the risks associated with telnet, unfortunately it is not up to me though, this is at my place of employment so I have no control over which to use. I've been shown how to successfully connect with putty, I then installed telnet on my linux box but it refuses to connect. Since telnet has been confirmed to work with putty on windows, I'm assuming the problem lies with my linux setup.

  6. #5
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Is the firewall running on the Linux machine? Disable it temporarily, to test:
    Code:
    service iptables stop
    Use a regular user (not root) to telnet in (root cannot telnet in by default). Add one if need be:
    Code:
    useradd -g users testuser
    echo testpass|passwd --stdin testuser
    Try telnet from localhost first (the machine the telnet server is running on):
    Code:
    telnet -l testuser localhost
    Also make sure TCP wrappers is not getting in the way. Do this to check the possibly offending config file:
    Code:
    cat /etc/hosts.deny
    Check /var/log/messages and /var/log/secure on the Linux server for errors messages.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •