Project three configuration and application remote connection service

Task 1 Configure TeInet service

Step 1: Mount the CD

Insert the CD into the CD-ROM drive, and then use the [mount /dev/cdrom /mnt] command to mount the CD to the system.

Step 2: Configure the YUM source

[cd /etc/yum.repos.d/] Enter the directory configured by YUM.

[mkdir /etc/yum.repos.d/bak] Create a backup folder.

[mv /etc/yum.repos.d/Cent* /etc/yum.repos.d/bak/] Move the original configuration file to the backup folder.

[vim /etc/yum.repos.d/local.repos] Edit your own repo file.

After editing, press the Esc key, enter [:wq] to save and exit.

Step 3: Install client and server software

[rpm -q telnet] Query the client software of Telnet.


[rpm -q telnet-server] Query the Telnet server software. If the installation information of Telnet related software is not queried, you need to use the following commands to install it.


[yum install -y telnet] Install the client software of Telnet.


[yum install -y telnet-server] Install Telnet server software.


Step 4: Modify the main configuration file

Use the [vim /etc/xinetd.d/telnet] command to edit the Telnet configuration file, find the line where disable=yes is located, change it to disable=no, and enable the Telnet function.

(1) Set the maximum number of connections. Add a line after disable=no: instance=4, which means that only 4 users are allowed to connect at the same time.

(2) Enable Telnet service on the server.

[/etc/init.d/xinetd restart] or [service xinetd restart] to restart the Telnet service.

[chkconfing xinetd on] Set the Telnet service to run in the system.

(3) Modify the connection port (default is 23).

[vim/etc/services] Modify the default port number provided by the server.

Use the [/etc/init.d/xinetd restart] command to restart the Telnet service on the server.

Step 5: Allow root user to log in

Use the [mv /etc/securetty /etc/securetty.bak] command to comment out the /etc/securetty file to make it fail.

Step 6: Log in from a third-party client

(1) Use PuTTY to log in remotely.


(2) Use SecureCRT to log in remotely.


Task 2 Configure the SSH service

Step 1: Check the installation of SSH software

[rpm -q openssh] View the installation of the SSH service client.


[ rpm -q openssh-server ] View the installation of the SSH server.


[yum install -y openssh] Install the openssh client.


[ yum install -y openssh-server ] Install the openssh server side.


Step 2: Interpret the main SSH configuration file

[service sshd start] Start the sshd service process.


[chkconfig sshd on] Configure the sshd service to start automatically after the server is powered on.


Step 3: Log in with third-party software

(1) Log in with PuTTY.


After clicking the [Open] button, you will be prompted to enter the user name and password of the server .

(2) Log in with SecureCRT.


After clicking the [Connect] button, enter the user name and password to log in to the server.

Step 4: Use the [scp] command to transfer files


(1) Start the SSH service on the Linux Server.

(2) Use [scp LINUXSERVER IP:/directory/file/local directory] on the client

Step 5: Use the [sz] and [rz] commands to transfer the remote host and the local file

[sz] Send the selected file to the local machine.


[rz] Running this command will pop up a file selection window, select the file from the local and upload it to the server (Receive).




Task 3 Configure the VNC GUI service

Step 1: Install the Gnome Graphical Desktop

[yum groupinstall "X Window System" "Desktop"] CentOS 6.x installs the Gnome desktop environment.


[yum groupinstall Xfce] Install Xfce desktop environment on CentOS, optional.


[yum groupinstall -y “Chinese Support”] Install Chinese support.



Step 2: Install the vncserver software

[yum install -y tigervnc-server tigervnc] Install the vncserver software.


Step 3: Configure VNC Password

[vncserver] Set the VNC password, the password must be more than 6 digits.

[vncpasswd] Modify the VNC password. Similarly, the password must be more than 6 digits.


Step Four: Configure to Use the Gnome Desktop

[vim /root/.vnc/xstartup] Open the main configuration file of the gnome desktop, modify the file, delete the last [twm &], and add [gnome-session & ].

Step 5: Configure the listening port and environment parameters after vncserver starts

[vim /etc/sysconfig/vncervers] Modify the configuration file and add the following two lines at the end:

VNCSERVERS="1:root"

VNCSERVERARGS[1]="- geometry 1024x768" -alwaysshared -depth 24"

Step 6: Set up the vncserver service to run in the system

[service vncserver restart] Restart the vncserver service.


[chkconfig vncserver on] Set the running cserver to start automatically.

Step 7: Test Login

Enter [VNC Viewer] in the network.

Enter the server IP address, and then click [OK].

Enter the password of the root account and click [OK].

Step 8: Troubleshoot

(1) Check the SELinux service and close it.

(2) Close the NetworkManager service.

(3) The iptables firewall will block by default.


Commands to restart the firewall or close the firewall directly:

[/etc/init.d/iptables restart] Restart the firewall.

【/etc/init.d/iptables stop】Close the firewall.

Step 9: VNC reverse connection settings

[vncviewer -listen] command to start vnc client,

【vncconnect -display :1 192.168.223.189】

Step 10: Fix possible black screen problems

【vncserver -kill :1】

vncserver -kill :2

[/etc/init.d/ vncserver restart ] The command restarts the vncserver service.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324712365&siteId=291194637