LinuxVNCServer multi-user access settings

Source: Internet
Author: User
LinuxVNCServer multi-user access settings-Linux Enterprise Application-Linux server application information, the following is a detailed description. 1.1 check whether the VNC Server is installed

# Rpm? Q vnc-server

If the version is already installed, the system displays the version information of the VNC Server.

Vnc-server-4.1.2-9.el5

1.2 set to enable the account automatically when VNC Server is started
Modify the/etc/sysconfig/vncservers file as root:

Vim/etc/sysconfig/vncservers

If you want to use the lincao and leiwang accounts to log on to the desktop at a resolution of 1280x1024, set it:

VNCSERVERS = "1: lincao 2: leiwang"

VNCSERVERARGS [1] = "-geometry 1280x1024-alwaysshared? Depth 16"

-Alwaysshared indicates that multiple terminals are allowed to log on at the same time, and-depth indicates the color resolution, which can be 8, 16, 24, and 32.

1.3 modify ~ /. Vnc/xstartup File
Vim ~ /. Vnc/xstartup

Remove the # annotator starting with SESSION_MANAGER and exec/etc/X11/xinit/xinitrc, twm & comment out, and change it to kdestart & (log on to J on the KDE Interface)

#! /Bin/sh

# Uncomment the following two lines for normal desktop:

Unset SESSION_MANAGER

Exec/etc/X11/xinit/xinitrc

# [-X/etc/vnc/xstartup] & exec/etc/vnc/xstartup

# [-R $ HOME/. Xresources] & xrdb $ HOME/. Xresources

# Xsetroot-solid gray

# Vncconfig-iconic &

# Xterm-geometry 80x24 + 10 + 10-ls-title "$ VNCDESKTOP Desktop "&

Kdestart &

# Twm &

1.4 set/modify VNC Server password
Enter the password for the first access:

Password: // set the initial password

Verify: // verify the initial password

You can also change the VNCServer password.

$ Vncpasswd

Password: // set the password

Verify: // verify the password

1.5 change firewall settings
Modify/etc/sysconfig/iptables with root permission

# Firewall configuration written by system-config-securitylevel

# Manual customization of this file is not recommended.

* Filter

: Input accept [0: 0]

: Forward accept [0: 0]

: Output accept [0: 0]

: RH-Firewall-1-INPUT-[0: 0]

-A input-j RH-Firewall-1-INPUT

-A forward-j RH-Firewall-1-INPUT

-A RH-Firewall-1-INPUT-I lo-j ACCEPT

-A RH-Firewall-1-INPUT-I eth0-j ACCEPT

-A RH-Firewall-1-INPUT-p icmp -- icmp-type any-j ACCEPT

-An RH-Firewall-1-INPUT-p 50-j ACCEPT

-An RH-Firewall-1-INPUT-p 51-j ACCEPT

-A RH-Firewall-1-INPUT-p udp -- dport 5353-d 224.0.0.20.- j ACCEPT

-A RH-Firewall-1-INPUT-p udp-m udp -- dport 631-j ACCEPT

-A RH-Firewall-1-INPUT-p tcp-m tcp -- dport 631-j ACCEPT

-A RH-Firewall-1-INPUT-m state -- state ESTABLISHED, RELATED-j ACCEPT

-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 5901-j ACCEPT

-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 5902-j ACCEPT

-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 5903-j ACCEPT

-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 5904-j ACCEPT

-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 5905-j ACCEPT

-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 5906-j ACCEPT

-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 5907-j ACCEPT

-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 5908-j ACCEPT

-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 5909-j ACCEPT

-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 5910-j ACCEPT

-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 5911-j ACCEPT

-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 5912-j ACCEPT

-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 22-j ACCEPT

-A RH-Firewall-1-INPUT-j REJECT -- reject-with icmp-host-prohibited

COMMIT

Note that the red part is newly added!

Restart iptables:

&/Etc/rc. d/init. d/iptables restart

Flushing firewall rules: [OK]

Setting chains to policy ACCEPT: filter [OK]

Unloading iptables modules: [OK]

Applying iptables firewall rules: [OK]

Loading additional iptables modules: ip_conntrack_netbios_n [OK]

Now you can log on to the workstation remotely through VNC Viewer.

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.