On Tue, May 29, 2012 at 1:53 PM, Rick Stevens <ricks(a)alldigital.com> wrote:
On 05/29/2012 01:26 PM, Rick Stevens wrote:
>
> On 05/29/2012 12:00 PM, Tommy Pham wrote:
>>
>> On Tue, May 29, 2012 at 11:18 AM, Rick Stevens<ricks(a)alldigital.com>
>> wrote:
>>>
>>> On 05/29/2012 10:26 AM, Tommy Pham wrote:
>>>>
>>>>
>>>> Hi,
>>>>
>>>> Is it possible to have remote access via VNC without having the user
>>>> to be logged in (automatically, especially on a system reboot)?
>>>
>>>
>>>
>>> You could share the display in the X configs, e.g.:
>>>
>>> cat /etc/X11/xorg.conf.d/00-system-setup-vnc.conf
>>> # This file is to share the root screen via VNC
>>> Section "Module"
>>> Â Â Load "vnc"
>>> EndSection
>>>
>>> Section "Screen"
>>> Â Â Identifier "Screen0"
>>> Â Â Device "Videocard0"
>>> Â Â Option "SecurityTypes" "VncAuth"
>>> Â Â Option "UserPasswdVerifier" "VncAuth"
>>> Â Â Option "passwordfile" "/root/.vnc/passwd"
>>>
>>> EndSection
>>>
>>> You may have to refresh the display after connecting when the user
>>> login screen is shown. I have to on occasion...something with the
>>> way the login mechanism (gdmgreeter?) updates the screen.
>>
>> Hi Rick,
>>
>> I just tried it why your suggested configuration but I'm still unable
>> to access via VNC.
>>
>> [root@fedora17 ~]# find / -type f -name 'passwd'
>> /sys/fs/selinux/class/passwd/perms/passwd
>> find: `/run/user/dlp/gvfs': Permission denied
>> /usr/share/bash-completion/completions/passwd
>> /usr/bin/passwd
>> /etc/pam.d/passwd
>> /etc/passwd
>>
>> I've rebooted the system with no effect.
>
>
> If you look, you'll see that I used a password file, /root/.vnc/passwd
> to hold the VNC passwords. You must create that file using "vncpasswd"
> on the VNC server and give the root user a password. When you
> authenticate VNC, you must give the root user's VNC password.
>
> You don't need to use the authentication, I guess (I always do). I also
> believe that, for selinux to like it, you have to change the SELinux
> context of the file:
>
> [root@golem4 .vnc]# ls -lZ /root/.vnc/passwd
> -rw-------. root root unconfined_u:object_r:admin_home_t:s0
> /root/.vnc/passwd
>
> To access the machines, I have been using vncviewer over an SSH tunnel:
>
> # vpnc -via golem4 golem4
Whoops! Sorry, that should read:
# vncviewer -via golem4 golem4
(yes, I use vpnc a lot, hence my mistake)
> I get a dialog box asking for root's VNC password. I put it in and the
> desktop shows up.
>
> You probably want to look at the /var/log/Xorg.0.log file on the VNC
> server machine to verify that the vnc module is actually being loaded.
----------------------------------------------------------------------
- Rick Stevens, Systems Engineer, AllDigital ricks(a)alldigital.com -
- AIM/Skype: therps2 ICQ: 22643734 Yahoo: origrps2 -
- -
- When you don't know what to do, walk fast and look worried. -
Hi Rick,
I still can't seem to get this right :(. This is what I have.
[root@ogx280 init.d]# rpm -qa|grep -i vnc
gtk-vnc2-0.5.0-2.fc17.i686
gtk-vnc-0.5.0-2.fc17.i686
gvnc-0.5.0-2.fc17.i686
tigervnc-license-1.1.0-5.fc17.noarch
libvncserver-0.9.8.2-4.fc17.i686
tigervnc-server-minimal-1.1.0-5.fc17.i686
gtk-vnc-python-0.5.0-2.fc17.i686
x11vnc-0.9.13-3.fc17.i686
[root@ogx280 init.d]# netstat -tapnv
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address
State PID/Program name
tcp 0 0 0.0.0.0:3000 0.0.0.0:*
LISTEN 1387/mysqld
tcp 0 0 127.0.0.1:25 0.0.0.0:*
LISTEN 1461/sendmail: acce
tcp 0 0 0.0.0.0:8222 0.0.0.0:*
LISTEN 1716/httpd
tcp 0 0 0.0.0.0:25962 0.0.0.0:*
LISTEN 664/rpc.statd
tcp 0 0 0.0.0.0:8333 0.0.0.0:*
LISTEN 1716/httpd
tcp 0 0 0.0.0.0:111 0.0.0.0:*
LISTEN 604/rpcbind
tcp 0 0 0.0.0.0:8181 0.0.0.0:*
LISTEN 1716/httpd
tcp 0 0 192.168.122.1:53 0.0.0.0:*
LISTEN 1415/dnsmasq
tcp 0 0 0.0.0.0:22 0.0.0.0:*
LISTEN 616/sshd
tcp 0 248 10.167.28.248:22 155.64.180.69:59101
ESTABLISHED 1892/sshd: root@pts
tcp6 0 0 :::111 :::*
LISTEN 604/rpcbind
tcp6 0 0 :::1521 :::*
LISTEN 1508/tnslsnr
tcp6 0 0 :::22 :::*
LISTEN 616/sshd
tcp6 0 0 :::39638 :::*
LISTEN 664/rpc.statd
tcp6 0 0 :::631 :::*
LISTEN 1/systemd
[root@ogx280 init.d]# chkconfig
Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration.
ceph 0:off 1:off 2:off 3:off 4:off 5:off 6:off
dbora 0:off 1:off 2:off 3:on 4:on 5:on 6:off
ebtables 0:off 1:off 2:off 3:off 4:off 5:off 6:off
iscsi 0:off 1:off 2:off 3:on 4:on 5:on 6:off
iscsid 0:off 1:off 2:off 3:on 4:on 5:on 6:off
netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off
network 0:off 1:off 2:off 3:off 4:off 5:off 6:off
psad 0:off 1:off 2:off 3:off 4:off 5:off 6:off
spice-vdagentd 0:off 1:off 2:off 3:off 4:off 5:on 6:off
zfs-fuse 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@ogx280 init.d]# ls /lib/systemd/system/*vnc*
ls: cannot access /lib/systemd/system/*vnc*: No such file or directory
[root@ogx280 init.d]# cat /etc/X11/xorg.conf.d/00-system-setup-vnc.conf
# This file is to share the root screen via VNC
Section "Module"
Load "vnc"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Videocard0"
Option "SecurityTypes" "VncAuth"
Option "UserPasswdVerifier" "VncAuth"
# Option "passwordfile" "/root/.vnc/passwd"
EndSection
[root@ogx280 init.d]# ll -a ~/.vnc
total 12
drwxr-xr-x. 2 root root 4096 May 30 13:06 .
dr-xr-x---. 7 root root 4096 May 30 13:07 ..
-rw-------. 1 root root 8 May 30 13:06 passwd
[root@ogx280 init.d]# cat /var/log/Xorg.0.log|grep -i vnc
[ 30.309] (II) LoadModule: "vnc"
[ 30.354] (WW) Warning, couldn't open module vnc
[ 30.354] (II) UnloadModule: "vnc"
[ 30.354] (II) Unloading vnc
[ 30.354] (EE) Failed to load module "vnc" (module does not exist, 0)
Thanks,
Tommy