Because schools have several HP server idle,I was thinking up the fiddle fiddle,Although ssh wonderful,But as a not-for CLI proud I still prefer white GUI。。。So,Consideration for a long time,We decided to come to a VNC remote desktop,As to penetrate the network,To be honest I'm still trying them
=。=
All right,Now we start,First talk about my system environment,It is Redhat 6.2,Well of course, no registration,I'll simply changed CentOS 6.2,so,Desktop environment is there,Gnome is 2,I do not installed。
Then install the vnc,Use the command
1 |
#yum install vnc-server pixman pixman-devel libXfont xterm |
Installtigervnc-server,This is very simple,Some shoving things depend on it also installed,If you do not install,vnc will prompt you to get up
font catalog not properly configured
Specific you canReference here,Here vnc server has been installed,Do not rush to start the service,Let's look at the configuration
1 |
#vi /etc/sysconfig/vncservers |
editvncserversWith the following entries inside
1 2 |
VNCSERVERS="1:root" VNCSERVERARGS[1]="-geometry 1024x768 -alwaysshared -depth 24" |
Explanation:
1、-alwayssharedIt represents the same display port allows multiple users to log -depthTook the color depth,There are 8 parameters、16、24、32;
2、Where "username" is the name linux system users;
3、The top of the first line specifies what user to log,1 is a front port number,vnc port number is 590 or * 580 *,Where the former is the client logs,The latter is a Java Web Log,We do not have time to install web server so you log IP behind to keep port 5901,If you are then separated by a space,He wrote a”2:abcd”So you log ip:5902Abcd is logged in to the desktop;
4、The following line[1]The best that corresponds to the above,It is used to do some custom settings for each desktop。The latter can be replaced with 800X600 resolution supported by your computer。Note the middle of the "x" instead of "*",But the lowercase letter "x"。
Set access password vnc
Note that this does not correspond to the permissions of the account password,But a separate password to access the required Oh vnc,To configure a password for the Desktop,You must configure this command under the corresponding authority to account。
1 |
#vncpasswd |
Vnc modify personal profile
After this so log in directly to the desktop is GNOME,Otherwise it is pitiful and the big box
1 |
# vi /root/.vnc/xstartup |
This file should not be generated,It does not matter that we directly create,Some on the amendment,Not created,Note the corresponding account
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#!/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 grey vncconfig -iconic & xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & gnome-session & #set starting GNOME desktop #startkde & #kde desktop #twm & #Text interface #/usr/bin/startxfce4 #exec /usr/bin/fluxbox |
Comment out the inside of a few lines is used to start the other corresponds to the desktop,Members of different versions of the readers on their own condemnation。
Next, remember to use the following command to give the fileGive permission
1 |
#chmod 755 /root/.vnc/xstartup |
Edit firewall settings
Firewall default to not release the vnc,You can turn off the firewall,Write a release or entry
1 2 |
#iptables -I INPUT -p tcp --dport 5902 -j ACCEPT # service iptables save |
Set vnc service from the start
1 |
# chkconfig vncserver on |
Finally, the service will be able to start the vnc
1 |
#vncserver |
or
1 |
#service vncserver start |
This is a summary of the content of my income network among all incomplete tutorial,They can not be original,However, various error inside I have to be modified,If there is anything at shortcomings,Welcome to remind you to leave a message I will immediately correct!
Original article written by LogStudio:R0uter's Blog » CentOS install VNC Server Remote Desktop Comments
Reproduced Please keep the source and description link:https://www.logcg.com/archives/331.html
Comments