2015-10-16

[SOLVED]remote linux using vncserver

1-creating vnc password for user.txt
#9:19 29/06/2015
################
#yum install tigervnc-server


Login to each user, and run
#vncpasswd.
root@oracle /etc/sysconfig# vncpasswd
Password: 310212
Verify: 310212
This will create a .vnc directory.

[~]$ cd .vnc
[.vnc]$ ls
passwd

2-Edit the server configuration.txt

Edit the server configuration

Edit /etc/sysconfig/vncservers, and add the following to the end of the file.

VNCSERVERS="1:root 2:oracle"
VNCSERVERARGS[1]="-geometry 1024x768"
VNCSERVERARGS[2]="-geometry 1024x768"

or
########################
VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 1024x768"

Larry will have a 640 by 480 screen, as will Moe. Curly will have an 800 by 600 screen.

3-Create xstartup script.txt
 Create xstartup scripts

=====We will create the xstartup scripts by starting and stopping the vncserver as root.
    # /sbin/service vncserver start
    # /sbin/service vncserver stop

=====Login to each user and edit the "xstartup" script. To use Larry as an example, first login as larry
    [~]$ cd .vnc
    [.vnc] ls
    mymachine.localnet:1.log  passwd  xstartup

=====Edit "xstartup". The original should look like:
nano /root/.vnc/xstartup
    #!/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" & twm &

=====Add the line indicated below to assure that an xterm is always present, and uncomment the two lines as directed if you wish to run the user's normal desktop window manager in the VNC. Note that in the likely reduced resolution and color depth of a VNC window the full desktop will be rather cramped and a look bit odd. If you do not uncomment the two lines you will get a gray speckled background to the VNC window.
#!/bin/sh
# Add the following line to ensure you always have an xterm available.
( while true ; do xterm ; done ) &
# 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" & twm &

4-Start the VNC server.txt
Start the vncserver as root.
# /sbin/service vncserver start

5-Testing with a vnc client.txt
For Larry: vncviewer 192.168.0.10:1
For   Moe: vncviewer 192.168.0.10:2
For Curly: vncviewer 192.168.0.10:3

To test larry using vncviewer, vncviewer 192.168.0.10:1. Enter Larry's VNC password, and a 640x480 window should open using Larry's default window manager. The vncviewer client will connect to port 590X where X is an offset of 1,2,3 for Larry, Moe, and Curly respectively, so these ports must be open in the firewall for the IP addresses or subnets of the clients. 


6-Starting vncserver at boot.txt
To start vncserver at boot, enter the command
#/sbin/chkconfig vncserver on

For basic VNC configuration the procedure is now complete. The following sections are optional refinements to enhance security and functionality.

7-login server using vnc client.txt
 2:03 PM Wed/01/12/2010
=====Su dung vnc client nhu:
    1.vnc-4_1_3-x86_win32_viewer.exe
    2.TightVNC
  
    Server Address:
    ROOT user: IP:1/123456
    ORACLE user: IP:2/123456

setting-up-vnc-server-in-one-file.txt
#ROOT MODE
cd /
vncpasswd
 /etc/sysconfig/vncservers

 .
 .
 .
 .

1-creating vnc password for user
2-Edit the server configuration
3-Create xstartup script
4-Start the VNC server
5-Testing with a vnc client
6-Starting vncserver at boot
7-login server using vnc client

No comments:

Post a Comment