Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation graphical interface of Red Hat Enterprise Linux 7.3 in aws and VNC connection under mac

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

First, we need an available desktop environment (X-Window), and if not, we need to install one first.

Note: the following commands must be run with root privileges.

1. Install X-Window

First we need to install X-Window, run the following command in the terminal, and the installation will take some time.

# yum check-update

# yum groupinstall "X Window System"

Installing x windows

# yum install gnome-classic-session gnome-terminal nautilus-open-terminal control-center liberation-mono-fonts

Install gnome classic session

# set the graphical interface to launch by default

# unlink / etc/systemd/system/default.target

# ln-sf / lib/systemd/system/graphical.target / etc/systemd/system/default.target

Configuring graphics

# reboot

After the server restarts, we have a working CentOS 7 desktop environment.

Now we are going to install the VNC server on the server.

two。 Install the VNC server

Now it's time to install the VNC server on our redhat 7. We need to carry out the following orders.

# yum install tigervnc-server-y

Vnc server

3. Configure VNC

Then we need to create a configuration file in the / etc/systemd/system/ directory. We can copy a sample configuration file of / lib/systemd/sytem/vncserver@.service.

# cp / lib/systemd/system/vncserver@.service / etc/systemd/system/vncserver@:1.service

Copying vnc server configuration

Open / etc/systemd/system/vncserver@:1.service with vim, find the following lines, and replace them with your own user name. For example, my user name is linoxide, so I replace it with linoxide:

ExecStart=/sbin/runuser-l-c "/ usr/bin/vncserver I"

PIDFile=/home//.vnc/%H%i.pid

Replace with

ExecStart=/sbin/runuser-l linoxide-c "/ usr/bin/vncserver% I"

PIDFile=/home/linoxide/.vnc/%H%i.pid

If it is a root user,

ExecStart=/sbin/runuser-l root-c "/ usr/bin/vncserver% I"

PIDFile=/root/.vnc/%H%i.pid

Configuring user

All right, let's restart systemd.

# systemctl daemon-reload

Finally, set the user's VNC password. To set a user's password, you must have permission to switch to the user through sudo. Here I use the permission of linoxide to execute "su linoxide".

# su linoxide

$sudo vncpasswd

Setting vnc password

Make sure that the password you enter is more than 6 characters

4. Start the service

Start the service (permanently) with the following command:

$sudo systemctl enable vncserver@:1.service

Start the service.

$sudo systemctl start vncserver@:1.service

5. Firewall Settin

We need to configure a firewall for the VNC service to work properly.

$sudo firewall-cmd-permanent-add-service vnc-server

$sudo systemctl restart firewalld.service

Allowing firewalld

You can now connect to the VNC server using IP and port number (for example, 192.168.1.1 LCTT 1, where the port is not the server's port, but sorted from 1 depending on the number of VNC connections).

6. Connect to the server with a VNC client

Well, the installation of the VNC server is now complete. To connect to the server using VNC, we also need a VNC client installed on the local computer for connecting to the remote computer only.

Remote access vncserver from vncviewer

You can use clients like Tightvnc viewer and Realvnc viewer to connect to the server.

To connect with more users, you need to create a profile and port, go back to step 3 and add a new user and port. You need to create a vncserver@:2.service and replace the user name in the configuration file and the corresponding file name and port number in the following steps. Please make sure that you log in to the VNC server with the same user name you used when you configured your VNC password.

The VNC service itself uses port 5900. Given that different users use VNC, everyone will get a different port for their connection. The number in the configuration file name tells the VNC server to run the service on subport 5900. In our example, the first VNC service will run on port 5901 (5900 + 1), and then increase in turn, running on port 5900 + x. Where x is the x in the user's profile name vncserver@:x.service.

Before establishing a connection, we need to know the IP address and port of the server. An IP address is a unique identification number of a computer in the network. The IP address of my server is 96.126.120.92jue VNC user port is 1.

Execute the following command to get the public IP address of the server (LCTT: if your server is placed on the intranet or uses a dynamic address, you can get its public IP address).

Obtain the public network address curl cip.cc

# curl-s checkip.dyndns.org | sed-e 's/.*Current IP Address: / /'- e's /

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report