Remote Linux operating system using VNC

Source: Internet
Author: User
Use VNC to remotely control the Linux operating system-general Linux technology-Linux technology and application information. The following is a detailed description. In movies, we often see that a hacker remotely controls a computer and can perform any operations on it, such as opening the camera of the other party. Is this difficult? Actually not. As long as you have the account and password of the other operating system, you can remotely control the Linux operating system. Today, I will introduce how to remotely control the Linux operating system through VNC.

I. features and applications of VNC.

Remote control is a technology in which one computer controls another computer. The controlled computer is called the controlled computer, and the computer that controls others' computers is called the control computer. When the control end is controlled by the control end, the control end can execute any application of the control end and use any system resources of the control end, just as if the user is sitting in front of the control end. The premise is that the account used by the master has the corresponding permissions. For example, the controller can easily open the camera on the passive side. Imagine what a terrible thing a user might not shut down his computer during lunch break if the camera is opened silently on the master side. However, when remote control technology was developed, its intention was good. As long as it is used to help the system administrator achieve remote management and remote assistance. It was later exploited by hackers to conduct some illegal activities.

In the open-source field, remote control technology is represented by VNC. VNC (Virtual Network Computer) is a set of software developed by AT&T lab that can control remote computers. This software is open-source. That is to say, anyone can obtain and use this software for free. The VNC software can be divided into two parts: VNC Server and VNC viewer. The former is installed on the controlled terminal, and the latter is installed on the master terminal. VNC software is not only open-source, but also cross-platform. That is to say, it can be used not only in Linux but also in Windows. For this reason, many system administrators may use Microsoft's operating system and prefer to use this VNC as a tool to remotely manage Linux servers or clients.

In addition, I have also used a commercial remote control software, which is a pcAnywhere tool developed by Symantec. This tool is relatively more powerful than VNC software. Both security and controllability cannot be compared. However, this software is commercial, and enterprises must pay for it. He does not support Linux, so far he can only use it on Windows. This greatly limits the scope of use. I will take the VNC software as an example to talk about how to remotely control the Linux operating system.

2. Start the VNC server on the Linux operating system.

The basic principle of Remote Control Using VNC software is that the master node initiates a connection request using the VNC client and establishes remote control after the control end agrees. In this case, the master can remotely control the control end. To remotely control the Linux operating system using the VNC software, you must first start the VNC server software on the Linux operating system. Otherwise, you cannot establish a VNC connection. However, in most Linux operating systems, such as Red Hat Linux systems, VNC servers are usually installed by default. However, it is usually disabled for security reasons. If the system administrator wants to use VNC for remote control, the system administrator needs to start the VNC server on the Linux operating system. As shown in:


In the Linux operating system command line, the system administrator can enter the vncserver command to start the VNC server. During the startup process, the operating system prompts the system administrator to enter the VNC connection password for security reasons. It is better for the system administrator to enter a complicated password here, such as a combination of English characters and numbers, to increase the difficulty of supplier deciphering. After a VNC connection is established, the master can operate on the control end as you would on your computer. Therefore, this password will be the final barrier to ensure its security.

After the password is configured, the Linux operating system returns the VNC connection address. As shown above, the system administrator can use mail.dfg.cn to remotely manipulate the Linux operating system. After entering this network address on the VNC client, you can connect to the VNC server. If you need to change the VNC connection password later, you need to use vncpasswd to change it. Note that it is not passwd. This is different from the command for changing the user password. Generally, as long as the network address is displayed normally, the VNC service starts normally.


In addition, to ensure security, it is best to disable the VNC application server on the server after the VNC Server is interrupted. To close the command above, you only need to run vncserver? Kill: 1 command. The last 1 indicates the number of the window that was previously started. The system administrator should develop a habit of shutting down a service immediately after it is started. One more service is an opportunity for multiple hackers to attack. Especially when using the operating system as a server, this habit can greatly improve the security of the server system. In fact, this is not only true for VNC servers, but also for other Telnet services. In general, the Linux operating system does not start services by default. After the system administrator starts them, the system administrator must close them in time.

However, if the enterprise layout is relatively large, such as from the office of the system administrator to the Linux operating system client, it takes half an hour. For ease of management, if the other party's operating system knowledge is used as a common client, then the Linux operating system can automatically start the VNC server at startup. The system administrator can connect to the VNC Server for remote troubleshooting or remote assistance in case of any problems. Due to the strict security requirements of the client, a certain degree of compromise can be made in terms of management convenience. However, if the operating system is used as a server, the system administrator must be cautious when starting the VNC server automatically. If the system administrator determines that the VNC Server is automatically started when the system needs to start up, you can use the ntsysv service to define it. That is, you only need to enter the command ntsysv in the command line state, and then select the vncserver entry (select by space). That is, if the VNC Server is set to start upon startup. Modify the/etc/sysconfig/vncservers configuration file. Find the VNCSERVER = "1: root" entry in this file. By default, the operating system comment out this line. The system administrator only needs to remove the annotator. After this setting, The VNC Server is automatically enabled after the operating system is started next time. In this way, the system administrator can remotely control the Linux operating system and perform software installation, system configuration, remote collaboration, and other operations.

3. Remote Control of the Linux operating system through multiple methods.

What should I do if the VNC client is not installed on the master terminal? For example, in Microsoft operating systems such as XP, VNC client software is not installed by default. If you want to use the VNC client, you need to download the free VNC software from the network for installation. This software is free of charge and does not require much space for installation. However, some system administrators may think it is troublesome. In fact, you can also remotely control a VNC without a VNC client. In other words, the Microsoft operating system browser itself can be used as a VNC client.

If you want to remotely control the Linux operating system through a browser, you should be careful when entering the URL. The basic format is the IP address of the host (or IP address of the host) on the controlled side: port number. If the controlled end is a Linux operating system, this port number is a bit special. The basic format of the port is 5800 + window number. As shown in, the window number enabled for VNC is 1, and its final address format is mail.dfg.cn: 5801. You can use this address to connect to the VNC server of the Linux operating system. In this case, the browser is like a VNC client, which can remotely control the Linux operating system. You can also install and enable the VNC server on the Microsoft operating system. However, if you remotely control the Microsoft VNC server through a browser, the window number in this address is different from that in the Linux operating system. In this case, the port number is 5800. You do not need to add a window number because Microsoft does not have a window number.
Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.