Solve the Problem of root User ftp login and telnet login in Linux-Linux Enterprise Application-Linux server application information. The following is a detailed description. 1. Solve the Problem of root User ftp login in Linux
Generally, for various reasons, ftp does not allow the root user to log on remotely, but you only need to modify a file to log on.
A. Remove or comment out the root in/etc/vsftpd/ftpusers.
B. Remove or comment out the root in/etc/vsftpd/user_list.
2. Modify the default ftp path.
My hard disk space is limited. How can I change the default ftp path/var/ftp of my account to another place? Or, all my linux directories are placed in the/root partition. Due to space shortage, can I put the default path of the ftp user to another partition?
Yes, you should do the following!
First, delete the ftp user.
# Userdel-r ftp
There will be error messages, but ignore them. This is normal.
Then we add this user. For example, if I want to set the Home Directory of the ftp account to/mnt/LinG/ftp, we can perform the following operations:
This is not enough because anonymous users cannot find their home directories. Therefore, we must change the permissions of the/mnt/LinG/ftp directory.
If no software package is detected, install it. By default, the telnet software package is installed in red hat linux 9. Generally, you only need to install the telnet-server software package.
1. Get the telnet-server-0.17-25.i386.rpm package from installation disk 3 of red hat linux 9.
2. install the software package
[Root @ echo root] # rpm? I telnet-server-0.17-25.i386.rpm
Ii. Start the telnet Service
1. Start the service
Method 1: Use ntsysv to add * Before telnet in the displayed window, and then press OK.
Method 2: edit/etc/xinetd. d/telnet
[Root @ echo root] # vi/etc/xinetd. d/telnet
Find disable = yes and change yes to no.
2. Activate the service
[Root @ echo root] # service xinetd restart
Iii. Test services
[Root @ echo root] # telnet ip (or hostname)
If the configuration is correct, the system prompts you to enter the user name and password of the remote machine.
Login:
Password:
Note: Only common users are allowed by default.
4. Set the telnet port
# Vi/etc/services
Go to edit mode and find telnet (input/telnet in vi editing mode)
The following content is found:
Telnet 23/tcp
Telnet 23/udp
Modify 23 to an unused port number (for example, 2000), exit vi, restart the telnet service, and modify the default port number for telnet.
V. Telnet service restrictions
Telnet is a plaintext transmission password and data. If you are not satisfied with the default settings, You need to restrict the service scope. If the ip address of your host is 210.45.160.17, you can set it 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.0/16 # Only 210.45.0.0 ~ is allowed ~ 210.45.255.255
Only_from = .edu.cn # Only CERNET can access!
No_access = 210.45.160. {115,116} # these two ip addresses cannot be logged on
Access_times =--# The service is only available for these two periods of time every day.
......
}
Vi. login from Telnet root User
Telnet is not safe. By default, the root user is not allowed to use telnet to access the Linux host. To allow the root user to log on, use the following methods:
(1)
[Root @ echo/root] # vi/etc/pam. d/login
# Auth required pam_securetty.so # Add comments to this line!
Or
[Root @ echo root] # mv/etc/securetty. bak
(2) edit the/etc/securetty file and add the following lines:
Pts/0
Pts/1
Pts/2
Pts/3
Test that the root user successfully logs on via telnet. In this way, the root user can directly access the Linux host. However, we recommend that you do not do this. You can also switch to the root user after a common user enters, with the root permission.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.