Как подключиться к сессии пользователя через x11vnc

Как правильно задавать вопросы Правильно сформулированный вопрос и его грамотное оформление способствует высокой вероятности получения достаточно содержательного и по существу ответа. Общая рекомендация по составлению тем: 1. Для начала воспользуйтесь поиском форума. 2. Укажите версию ОС вместе с разрядностью. Пример: LM 19.3 x64, LM Sarah x32 3. DE. Если вопрос касается двух, то через запятую. (xfce, KDE, cinnamon, mate) 4. Какое железо. (достаточно вывод inxi -Fxz в спойлере (как пользоваться спойлером смотрим здесь)) или же дать ссылку на hw-probe 5. Суть. Желательно с выводом консоли, логами. 6. Скрин. Просьба указывать 2, 3 и 4 независимо от того, имеет ли это отношение к вопросу или нет. Так же не забываем об общих правилах Как пример вот
Аватара пользователя

Автор темы
sana-555
Сообщения: 427
Зарегистрирован: 21 июл 2017, 20:38
Благодарил (а): 385 раз
Поблагодарили: 8 раз
Контактная информация:

Как подключиться к сессии пользователя через x11vnc

#1

01 авг 2017, 15:39

Настроил сервер x11vnc в гостевой системе ltsp через ltsp-chroot по следующему мануалу:

Код: Выделить всё

Установка x11vnc

# Скачиваем пакет
apt-get -y install x11vnc

# Создаем скрипт запуска
cat > /usr/bin/x11vncd <<EOT
#!/bin/bash
x11vncd () {
     XAUTH=\`ls -1td /var/run/ldm-xauth-* | head -n1 | sed 's|$|/Xauthority|'\`
     logger -f /var/log/x11vnc "Starting with \$XAUTH"
     /usr/bin/x11vnc -display :7 -rfbauth /etc/x11vnc.pass -logfile /var/log/x11vnc -xauth \$XAUTH 
     sleep 1
     x11vncd
}
x11vncd
EOT

# Создаем init-скрипт
cat > /etc/init.d/x11vnc <<EOT
#!/bin/sh

### BEGIN INIT INFO
# Provides:x11vnc
# Required-Start:\$remote_fs \$syslog
# Required-Stop:\$remote_fs \$syslog
# Default-Start:2 3 4 5
# Default-Stop:0 1 6
# Short-Description:Start X11VNC
# Description:Start VNC server X11VNC at boot
### END INIT INFO

case "\$1" in
        start) 
                start-stop-daemon --start --oknodo --pidfile /var/run/x11vnc.pid --background --nicelevel 15 --make-pidfile --exec /usr/bin/x11vncd
        ;;
        stop)  
                logger -f /var/log/x11vnc "Stopping"
                start-stop-daemon --stop --oknodo --pidfile /var/run/x11vnc.pid
        ;;
        restart)
                logger -f /var/log/x11vnc "Restarting"
                \$0 stop
                \$0 start
        ;;
        status)
                PID=\`cat /var/run/x11vnc.pid\`
                if [ -e /proc/\$PID ]; then
                        echo "Process \$PID is running"
                else   
                        echo "No process matching"
                fi
        ;;
        *)
                echo "Usage: \$0 start|stop|restart|status"
                exit 1
        ;;
esac
exit 0
EOT

# Разрешаем выполнение
chmod +x /usr/bin/x11vncd /etc/init.d/x11vnc
# Включаем службу при запуске
update-rc.d x11vnc defaults
# Задаем пароль
x11vnc -storepasswd /etc/x11vnc.pass
С помощью какой команды теперь можно подключиться к сессии пользователя?

Аватара пользователя

Автор темы
sana-555
Сообщения: 427
Зарегистрирован: 21 июл 2017, 20:38
Благодарил (а): 385 раз
Поблагодарили: 8 раз
Контактная информация:

Как подключиться к сессии пользователя через x11vnc

#2

02 авг 2017, 18:23

Пробую подключиться к клиенту так:

Код: Выделить всё

x11vnc -usepw -display :192.168.1.207 -q -forever
Узнал про клиента так:

Код: Выделить всё

sana@sana-VirtualBox ~ $ who
sana     tty7         2017-08-02 19:49 (:0)
xxx      pts/1        2017-08-02 20:18 (192.168.1.207)
выдает:

Код: Выделить всё

02/08/2017 20:21:53 ***************************************
02/08/2017 20:21:53 *** XOpenDisplay failed (:192.168.1.207)

*** x11vnc was unable to open the X DISPLAY: ":192.168.1.207", it cannot continue.
*** There may be "Xlib:" error messages above with details about the failure.

Some tips and guidelines:

** An X server (the one you wish to view) must be running before x11vnc is
   started: x11vnc does not start the X server.  (however, see the -create
   option if that is what you really want).

** You must use -display <disp>, -OR- set and export your $DISPLAY
   environment variable to refer to the display of the desired X server.
 - Usually the display is simply ":0" (in fact x11vnc uses this if you forget
   to specify it), but in some multi-user situations it could be ":1", ":2",
   or even ":137".  Ask your administrator or a guru if you are having
   difficulty determining what your X DISPLAY is.

** Next, you need to have sufficient permissions (Xauthority) 
   to connect to the X DISPLAY.   Here are some Tips:

 - Often, you just need to run x11vnc as the user logged into the X session.
   So make sure to be that user when you type x11vnc.
 - Being root is usually not enough because the incorrect MIT-MAGIC-COOKIE
   file may be accessed.  The cookie file contains the secret key that
   allows x11vnc to connect to the desired X DISPLAY.
 - You can explicitly indicate which MIT-MAGIC-COOKIE file should be used
   by the -auth option, e.g.:
       x11vnc -auth /home/someuser/.Xauthority -display :0
       x11vnc -auth /tmp/.gdmzndVlR -display :0
   you must have read permission for the auth file.
   See also '-auth guess' and '-findauth' discussed below.

** If NO ONE is logged into an X session yet, but there is a greeter login
   program like "gdm", "kdm", "xdm", or "dtlogin" running, you will need
   to find and use the raw display manager MIT-MAGIC-COOKIE file.
   Some examples for various display managers:

     gdm:     -auth /var/gdm/:0.Xauth
              -auth /var/lib/gdm/:0.Xauth
     kdm:     -auth /var/lib/kdm/A:0-crWk72
              -auth /var/run/xauth/A:0-crWk72
     xdm:     -auth /var/lib/xdm/authdir/authfiles/A:0-XQvaJk
     dtlogin: -auth /var/dt/A:0-UgaaXa

   Sometimes the command "ps wwwwaux | grep auth" can reveal the file location.

   Starting with x11vnc 0.9.9 you can have it try to guess by using:

              -auth guess

   (see also the x11vnc -findauth option.)

   Only root will have read permission for the file, and so x11vnc must be run
   as root (or copy it).  The random characters in the filenames will of course
   change and the directory the cookie file resides in is system dependent.

See also: http://www.karlrunge.com/x11vnc/faq.html

Аватара пользователя

Автор темы
sana-555
Сообщения: 427
Зарегистрирован: 21 июл 2017, 20:38
Благодарил (а): 385 раз
Поблагодарили: 8 раз
Контактная информация:

Как подключиться к сессии пользователя через x11vnc

#3

02 авг 2017, 20:50

Упс, я наверное не в ту ветку запостил... Это не руководство, а вопрос...) Просьба перенести в соответствующую ветку.

Аватара пользователя

Автор темы
sana-555
Сообщения: 427
Зарегистрирован: 21 июл 2017, 20:38
Благодарил (а): 385 раз
Поблагодарили: 8 раз
Контактная информация:

Как подключиться к сессии пользователя через x11vnc

#4

03 авг 2017, 12:10

Не верю, что никто не знал..) Вообщем решил вопрос установкой remmina и доп. плагинов rdp и vnc. По vnc подключился, правда сначала почему то вылетал рабчий стол, но увеличив цветность все завелось: http://forum.ubuntu.ru/index.php?topic=270403.0
Думал, что узнаю о возможности подключиться напрямую через терминал, без ремины, ну и так сойдет...)

Аватара пользователя

Dja
Сообщения: 6875
Зарегистрирован: 27 авг 2016, 20:03
Решено: 30
Откуда: Voskresensk
Благодарил (а): 1312 раз
Поблагодарили: 724 раза
Контактная информация:

Как подключиться к сессии пользователя через x11vnc

#5

03 авг 2017, 12:13

sana-555, vnc-server vnc-client
лучше реммины ничего нет. Да и зачем что-то набирать в консоли когда реммина позволяет сохранять? В трее отображается. Там выбрал нужный тебе хост - и подключился.
Консольным подключением у меня получалось, но окно получается не совсем удобное.

Закрыто

Вернуться в «Работа с сетью»

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и 4 гостя