Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am a new Linux admin setting up a brand new Linux virtual machine (VM). When I do a uname -r, I see it is running 3.10.0-1160.83.1.el7.x86_64, which I assume is CentOS.
About a week after the machine was turned up, I got an email from security stating they had performed a port scan on my machine and detected that telnet (port) 23 was turned on. They asked me to turn it off.
I immediately started Googling and found many references about editing /etc/xinetd.d/telnet. Most state that I open # vi /etc/xinetd.d/telnet and change diable=no to disable=yes.
Unfortunately, there is no such file /etc/xinetd.d/telnet on my machine to edit.
So, I am looking for an alternative way to permanently disable telnet port 23.
I am a new Linux admin setting up a brand new Linux virtual machine (VM). When I do a uname -r, I see it is running 3.10.0-1160.83.1.el7.x86_64, which I assume is CentOS.
You can also run "cat /etc/*release*", and you'll get output similar to:
About a week after the machine was turned up, I got an email from security stating they had performed a port scan on my machine and detected that telnet (port) 23 was turned on. They asked me to turn it off. I immediately started Googling and found many references about editing /etc/xinetd.d/telnet. Most state that I open # vi /etc/xinetd.d/telnet and change diable=no to disable=yes.
Unfortunately, there is no such file /etc/xinetd.d/telnet on my machine to edit. So, I am looking for an alternative way to permanently disable telnet port 23.
You can check with:
Code:
systemctl is-enabled telnet.socket
..and you should see the status. If it's not disabled, run:
Code:
systemctl disable telnet.socket
..and recheck.
That said, why on EARTH would you be putting a NEW CentOS7 server in place??? It's very old, and will hit end-of-life soon. Use a current version of Linux on a new server.
Is this some type hosted virtual machine? By default CentOS does not automatically install telnet (it is a stand alone server and does not run under xinetd) so I would think that would be on your hosted service provider. Have you verified that telnet or anything is running or port 23? As root or via sudo try running the command on the server:
# cat /etc/*release*
CentOS Linux release 7.9.2009 (Core)
Derived from Red Hat Enterprise Linux 7.9 (Source)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
CentOS Linux release 7.9.2009 (Core)
CentOS Linux release 7.9.2009 (Core)
cpe:/o:centos:centos:7
Then I checked to see if telnet is disabled:
Code:
# systemctl is-enabled telnet.socket
disabled
So it appears as if telnet is indeed disabled. Is there a way I can scan port 23 myself to verify it is not open?
You can use any network scanning tool to do this, aside from the fact you got other suggestions here on how to check it. You also seem to avoid addressing the issue of *WHY* you're using such an old version of CentOS on a brand-new server in a company environment.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.