INSTALL,CONFIGURE AND TEST VNC
INSTALL,CONFIGURE AND TEST VNC
yum install tigervnc-server
cd /usr/lib/systemd/system
ls
we are looking at conf file to create a template
i:e - vncserver@.service
create our own from this tmplate
cp vncserver@.service vncserver@\:5.service
\ -inserted bcz to reconsize : never put 0 (place any no u want)
vim vncserver@:/5.service
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/usr/sbin/runuser -l <USER> -c "/usr/bin/vncserver %i"
PIDFile=/home/<USER>/.vnc/%H%i.pid
inplace of USER give the regular username do not put root (either existing or newly created one)
ex:
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/usr/sbin/runuser -l <neelima> -c "/usr/bin/vncserver %i"
PIDFile=/home/<neelima>/.vnc/%H%i.pid
enable service when system boots up
systemctl enable vncserver@\:5.service
allow port at fw
firewall-cmd --permanent --add-port=5905/tcp
firewall-cmd --reload
now change to user acount
su neelima
now start vncserver
vncserver
it asks for pwd: provide it
o/p:
[neelima@localhost ~]$ vncserver
You will require a password to access your desktops.
Password:
Verify:
Would you like to enter a view-only password (y/n)? n
A view-only password is not used
xauth: file /home/neelima/.Xauthority does not exist
New 'localhost.localdomain:2 (neelima)' desktop is localhost.localdomain:2
Creating default startup script /home/neelima/.vnc/xstartup
Creating default config /home/neelima/.vnc/config
Starting applications specified in /home/neelima/.vnc/xstartup
Log file is /home/neelima/.vnc/localhost.localdomain:2.log
set pwd for vnc , user neelima already has a pwd
vncpasswd neelima
now go to client machine
(vncviewer -via 192.168.0.84@creator localhost:5
localhost:5 -menas where u want to open the session)
yum search tigervnc
yum install tigervnc
it is a client to connect ur server
now enter below cmd to connect the server
vncviewer -via 192.168.0.84@creator localhost:5
if it is not connected. troubleshoot
systemctl daemon-reload
nmap 192.168.0.84
dhclinet (if it is not connetced to internet)
once it got connected
it asks for cotinuing connection: yes
it asks vnc authentication pwd(not user pwd)
now u connected to remote server (remote desktop)
with given user
here it is neelima
enter pwd
now remote desktop is ready
u can check by ifcfg
or whoami
this whole indeed a remote desktop protocol
yum install tigervnc-server
cd /usr/lib/systemd/system
ls
we are looking at conf file to create a template
i:e - vncserver@.service
create our own from this tmplate
cp vncserver@.service vncserver@\:5.service
\ -inserted bcz to reconsize : never put 0 (place any no u want)
vim vncserver@:/5.service
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/usr/sbin/runuser -l <USER> -c "/usr/bin/vncserver %i"
PIDFile=/home/<USER>/.vnc/%H%i.pid
inplace of USER give the regular username do not put root (either existing or newly created one)
ex:
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/usr/sbin/runuser -l <neelima> -c "/usr/bin/vncserver %i"
PIDFile=/home/<neelima>/.vnc/%H%i.pid
enable service when system boots up
systemctl enable vncserver@\:5.service
allow port at fw
firewall-cmd --permanent --add-port=5905/tcp
firewall-cmd --reload
now change to user acount
su neelima
now start vncserver
vncserver
it asks for pwd: provide it
o/p:
[neelima@localhost ~]$ vncserver
You will require a password to access your desktops.
Password:
Verify:
Would you like to enter a view-only password (y/n)? n
A view-only password is not used
xauth: file /home/neelima/.Xauthority does not exist
New 'localhost.localdomain:2 (neelima)' desktop is localhost.localdomain:2
Creating default startup script /home/neelima/.vnc/xstartup
Creating default config /home/neelima/.vnc/config
Starting applications specified in /home/neelima/.vnc/xstartup
Log file is /home/neelima/.vnc/localhost.localdomain:2.log
set pwd for vnc , user neelima already has a pwd
vncpasswd neelima
now go to client machine
(vncviewer -via 192.168.0.84@creator localhost:5
localhost:5 -menas where u want to open the session)
yum search tigervnc
yum install tigervnc
it is a client to connect ur server
now enter below cmd to connect the server
vncviewer -via 192.168.0.84@creator localhost:5
if it is not connected. troubleshoot
systemctl daemon-reload
nmap 192.168.0.84
dhclinet (if it is not connetced to internet)
once it got connected
it asks for cotinuing connection: yes
it asks vnc authentication pwd(not user pwd)
now u connected to remote server (remote desktop)
with given user
here it is neelima
enter pwd
now remote desktop is ready
u can check by ifcfg
or whoami
this whole indeed a remote desktop protocol
Comments
Post a Comment