Remote Management Service for CentOS7#
Experimental Environment:#
- CentOS7: 192.168.0.1
- Windows7: 192.168.0.2
Experimental Steps#
-
Set up the network environment (connect two hosts to vmnet1).
-
Set IP addresses.
-
To ensure smooth experimentation: Disable firewall and SELinux on CentOS7.
-
Test connectivity with
ping
(Windows client pinging CentOS7 server). -
Install
telnet-server
software on CentOS7. -
Start the telnet service:
systemctl start telnet.socket
. -
Remote connect from Windows7 client (using built-in telnet tool or third-party telnet tool).
-
Log in to CentOS using an account (for security reasons: by default, root can only log in locally and not remotely).
Solution: Use a regular user account to log in and then switch to root using the su command:
Method to add a regular user:
user add mike (create mike user) passwd mike 123 (set mike user password)
Method for remote login from Windows:
telnet 192.168.0.1 After successful login: su root Enter root user password
Introduction to Third-Party Remote Login Tools#
SecureCRT
putty
How to Log in to Telnet with the root Account (Not Recommended)#
Telnet transmits data in plain text and is not secure.
Edit: Add to /etc/securetty
:
pts/0 (allow one thread to connect simultaneously)
pts/1 (allow two threads to connect simultaneously)
Connecting to CentOS7 using SSH#
The SSH server will start with the CentOS boot and is a daemon process.
We can use the following command to check if the SSH service is running:
systemctl status sshd.service
We can also use the following commands to start, stop, and restart the SSH service:
systemctl start sshd.service # Start SSH service
systemctl restart sshd.service # Restart SSH service
systemctl enable sshd.service # Enable SSH auto-start on boot
systemctl stop sshd.service # Stop SSH service
SSH connection uses encrypted transmission and is recommended over telnet.
ssh -p22 [email protected]
-p
is optional, if not specified, the default is -p22
(22 is the default SSH port).
root
is the username.
@
is the connector between the username and the hostname or IP address.
192.168.0.1
is the hostname or IP address of the connection.