Home Operation and Maintenance Linux Operation and Maintenance How to configure the port of Tigervnc in Debian system

How to configure the port of Tigervnc in Debian system

Apr 13, 2025 am 06:57 AM
Firewall configuration

How to configure the port of Tigervnc in Debian system

This article guides you how to configure the port of the Tigervnc server on a Debian system.

1. Install Tigervnc server

First, make sure that the Tigervnc server is installed. If not installed, execute the following command:

 sudo apt update
sudo apt install tigervnc-standalone-server tigervnc-common
Copy after login

2. Configure the Tigervnc server

The Tigervnc configuration file is usually located in ~/.vnc/xstartup . You can edit this file to set ports and other parameters.

Edit the xstartup file:

Open or create a ~/.vnc/xstartup file using a text editor (such as nano):

 nano ~/.vnc/xstartup
Copy after login

Adjust file contents according to your desktop environment. The following example applies to the GNOME desktop environment:

 #!/bin/sh

unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
gnome-session &
Copy after login

Other desktop environments (such as KDE, XFCE) need to be modified accordingly.

3. Set up custom ports

Tigervnc uses port 5900 n by default (n is the display number). You can customize the port by launching the script. Create or edit the startup script ~/.vncserver :

 nano ~/.vncserver
Copy after login

Add the following and replace 5902 with the port number of your choice:

 #!/bin/sh

export VNCPORT=5902
vncserver:1
Copy after login

Grant script execution permissions:

 chmod x ~/.vncserver
Copy after login

4. Start the Tigervnc server

Start the server with the following command:

 ~/.vncserver
Copy after login

Or use a custom port:

 ~/.vncserver:1
Copy after login

5. Connect to VNC server

Use the VNC client to connect to the specified port (e.g. localhost:5902 ).

6. Firewall configuration

Allows the firewall to pass through a custom port. For example, use ufw:

 sudo ufw allows 5902/tcp
Copy after login

Summary: Follow the above steps to successfully configure the Tigervnc port in the Debian system. Please make sure the configuration file is correct and the corresponding port is opened in the firewall.

The above is the detailed content of How to configure the port of Tigervnc in Debian system. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Why can't I download Google Chrome in Windows 7? Why can't I download Google Chrome in Windows 7? Apr 13, 2024 pm 11:00 PM

Reasons why you can't download Google Chrome on Windows 7: The operating system version is too old; security protocols are out of date; necessary components are missing; blocked by firewall or security software; network connection issues. Solution: Upgrade operating system, enable TLS 1.2, install necessary components, check firewall, check network connection.

Why can't the win11 control panel open? Why can't the win11 control panel open? Apr 17, 2024 pm 02:15 PM

Reasons why Windows 11 Control Panel won't open may include: Process conflicts Corrupted files Virus or malware infection Registry errors Permission issues Windows updates Hardware issues Other reasons (corrupted system files, conflicting drivers, or firewall configurations)

How to install and configure DRBD on CentOS7 system? Tutorial on implementing high availability and data redundancy! How to install and configure DRBD on CentOS7 system? Tutorial on implementing high availability and data redundancy! Feb 22, 2024 pm 02:13 PM

DRBD (DistributedReplicatedBlockDevice) is an open source solution for achieving data redundancy and high availability. Here is the tutorial to install and configure DRBD on CentOS7 system: Install DRBD: Open a terminal and log in to the CentOS7 system as administrator. Run the following command to install the DRBD package: sudoyuminstalldrbd Configure DRBD: Edit the DRBD configuration file (usually located in the /etc/drbd.d directory) to configure the settings for DRBD resources. For example, you can define the IP addresses, ports, and devices of the primary node and backup node. Make sure there is a network connection between the primary node and the backup node.

The best Linux version of 2024: perfect integration of technology and art, open and innovative attitude towards life The best Linux version of 2024: perfect integration of technology and art, open and innovative attitude towards life Apr 03, 2024 am 08:01 AM

As a Linux enthusiast in 2024, my expectations for the best Linux distribution are exciting. Below, I will explain my personal views and analyze why the most attractive Linux distribution in 2024 has many unique advantages. 1. First introduction to the most beautiful Linux distribution. There is no doubt that the best Linux distribution in 2024 can be called the perfect fusion of technology and art. It has excellent performance in many aspects such as user interface, function planning and performance optimization, making it unique in the face of many competitors. This is not only an operating system, but also a symbol of a free, open and innovative attitude towards life. This optimal version incorporates a new design and interactive mode, which is bound to be refreshing. Whether it is layout structure, logo pattern or color matching,

Complete guide to install FTPS service on Linux system Complete guide to install FTPS service on Linux system Mar 19, 2024 am 11:39 AM

Title: A complete guide to installing FTPS service under Linux system In Linux system, setting up an FTP server is a common requirement. However, in order to enhance the security of data transmission, we can choose to install the FTPS service, which adds SSL/TLS encryption function based on the FTP protocol. Through the FTPS service, we can upload and download files while ensuring the security of data transmission. This article will provide a detailed guide for installing FTPS service under Linux system and provide specific instructions.

How to configure your CentOS system to protect against malware and viruses How to configure your CentOS system to protect against malware and viruses Jul 05, 2023 am 10:25 AM

How to configure CentOS systems to prevent malware and virus intrusions Introduction: In today's digital era, computers and the Internet have become an indispensable part of people's daily lives. However, with the popularization of the Internet and the continuous advancement of computer technology, network security problems have become increasingly serious. The intrusion of malware and viruses poses a great threat to the security of our personal information and the stability of our computer systems. In order to better protect our computer systems from malware and viruses, this article will introduce how to configure Cent

Windows 11 Build 22621.2506 official version update released, complete update log pushed! Windows 11 Build 22621.2506 official version update released, complete update log pushed! Feb 12, 2024 pm 02:00 PM

New news! Microsoft officially released the official version of win11 on the morning of October 26, with version number 22621.2506. This new system has added many new features, such as centralized AI-assisted preview, file manager updates, and the addition of modern file resources supported by WinUI. Manager homepage, etc., the detailed update log is provided below. Build 22621.2506 update log: [Emphasis] Copilot in Windows Preview is new! This update adds centralized AI-assisted previews, known as Copilot in Windows. This makes Windows 11 the first PC platform to add centralized AI assistance to help you get your work done. Start menu new! When you move the mouse

CentOS7 tutorials on commands to view open ports, view port occupancy, open ports, kill processes and other commands. CentOS7 tutorials on commands to view open ports, view port occupancy, open ports, kill processes and other commands. Feb 19, 2024 am 10:54 AM

The following is a command tutorial for viewing open ports, viewing port occupancy, opening ports and killing processes on CentOS7: View open ports: Use the firewall-cmd command to view the open ports in the current firewall rules: sudofirewall-cmd--list- ports Check the port occupancy: Use the netstat command to check the occupancy of all ports on the current system: netstat-tuln If you only want to check the occupancy of the specified port, you can replace the port number with the port you want to check. Open the port: Use the firewall-cmd command to open the specified port: sudofirewall-cmd--add-po

See all articles