In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "the basic use of telnet services under the Linux system". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
one。 Enable the telnet service
For security reasons, linux does not allow telnet by default. If you need to use the telnet service, first you need to turn on the service.
The methods are as follows:
1.
The code is as follows:
Cp / etc/xinetd.d/telnet / etc/xinetd.d/telnet.bak
(first of all, make a backup in case there is a problem in the future. Get into this habit.)
two。
The code is as follows:
Vi / etc/xinetd.d/telnet
Change the ending disable=yes to no. Save exit
3. Restart the xinetd service
The code is as follows:
Service xinetd restart
OK, now you can use the telnet service (of course your firewall settings are allowed)
4. Allow telnet service to be started automatically when powered on
Because telnet is integrated into xinetd, you can just start xinetd when you turn it on.
The code is as follows:
Ntsysv
Choice
The code is as follows:
Xinetd
Or
The code is as follows:
Chkconfig xinetd-level 345 on
Ok as soon as you enter.
Second, allow root to log in.
Method 1:
Edit / etc/pam.d/login, remove
The code is as follows:
Auth required / lib/security/pam_securetty.so
This sentence
Method 2:
Edit / etc/securetty
Add at the end:
The code is as follows:
Pts/0,pts/1...
(adding a pts/0 will allow a root login, and adding to pts/n will allow a root login. )
Matters needing attention in using telnet
1. For security purposes, it is good not to allow login as root.
2. If you need root permission to perform tasks, you can do this:
The code is as follows:
Telnet 192.168.0.7 (your host IP)
Type your login name, such as bill, after login:
Enter your password after password:
You can log in successfully.
Then at the prompt, enter: su-root
Enter the password for root. You can perform the duties of root. Note: if you enter su directly, and then enter the root password, you may be prompted: "comman is not find"
4. Set the telnet port
The code is as follows:
# vi / etc/services
Find telnet after entering edit mode (enter / telnet in vi editing mode)
You will find the following:
The code is as follows:
Telnet 23/tcp
Telnet 23/udp
Change 23 to an unused port number (such as 2000), exit vi, restart the telnet service, and the default port number of Telnet is changed.
V. restrictions on Telnet services
Telnet sends passwords and data in clear text, and if you are not satisfied with its default settings, it is necessary to limit its scope of service. Assuming that the ip of your host is 210.45.160.17, you can set it as follows, ^ _ ^!
The code is as follows:
# vi / etc/xinetd.d/telnet
Service telnet
{
Disable = no # activate the telnet service, no
Bind = 210.45.160.17 # your ip
Only_from = 210.45.0.0amp 16 # only allows access to the network segment 210.45.0.0 ~ 210.45.255.255
Only_from = .edu.cn # only Education Network can enter!
No_access = 210.45.160. {115116} # these two ip are not logged in
Access_times = 8:00-12:00 20:00-23:59 # Service is open only during these two hours of the day
.
}
This is the end of the content of "basic usage of telnet Services under the Linux system". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.