LINUX.ORG.RU

sudo -u startx


0

0

Подскажите пожалуйста, как можно запустить X-Сервер с помощью su или sudo от имени xguest. Команда запуска:

startx xfce4 -- :2

Консоль, с которой запускается х-сервер - bash-скрипт. Скрипт запущен от имени root простым пользователем (планируется регистрация скрипта в sudoers).
Испробованные варианты:
[root@host ~]# su -c "startx xfce4 -- :2" xguest            
xauth:  creating new authority file /home/xguest/.serverauth.1477                                                             
Authentication failed - cannot start X server.
Perhaps you do not have console ownership?xinit:  Server error.       
[root@host ~]# su - -c "startx xfce4 -- :2" xguest
xauth:  creating new authority file /home/xguest/.serverauth.4360
Authentication failed - cannot start X server.
Perhaps you do not have console ownership?xinit:  Server error.
[root@host ~]# sudo -u xguest startx xfce4 -- :2
xauth:  timeout in locking authority file /root/.serverauth.1831
xauth:  timeout in locking authority file /root/.xauthJtAXJC
xauth:  timeout in locking authority file /root/.xauthJtAXJC
xauth:  timeout in locking authority file /root/.xauthJtAXJC
xauth:  timeout in locking authority file /root/.xauthJtAXJC
Authentication failed - cannot start X server.
Perhaps you do not have console ownership?xinit:  Server error.
xauth:  timeout in locking authority file /root/.xauthJtAXJC
rm: невозможно удалить `/root/.serverauth.1831': Отказано в доступе
[root@host ~]# sudo -u xguest -i startx xfce4 -- :2
xauth:  creating new authority file /home/xguest/.serverauth.2424
xauth:  timeout in locking authority file /root/.xauthJtAXJC
xauth:  timeout in locking authority file /root/.xauthJtAXJC
xauth:  timeout in locking authority file /root/.xauthJtAXJC
xauth:  timeout in locking authority file /root/.xauthJtAXJC
Authentication failed - cannot start X server.
Perhaps you do not have console ownership?xinit:  Server error.
xauth:  timeout in locking authority file /root/.xauthJtAXJC
[root@host ~]#

Исходная задача - написать скрипт, который активирует пользователя xguest, запускает xfce на втором граф.терминале от имени xguest, ждёт завершения (либо убивает xfce по таймауту, допустим полчаса) и блокирует пользователя xguest.
Всем заранее спасибо!

ЕМНИП это невозможно, икс сервер запускается с рутовыми правами, кто то когда то патчил иксы для запуска их с правами пользователя но так все на этом и заглохло.

splinter ★★★★★
()
Ответ на: комментарий от splinter

Я заходил с консоли (Ctrl+Alt+F5) под гостём, набирал там

startx xfce4 -- :2
- и это работало! Теперь вопрос, как прикрутить эту команду к sudo.

Northsoft ★★
() автор топика
Ответ на: комментарий от fluorite
[root@host ~]# sudo -u xguest -i "startx xfce4 -- :2"
xauth:  creating new authority file /home/xguest/.serverauth.8347
xauth:  timeout in locking authority file /root/.xauth8oJjfo
xauth:  timeout in locking authority file /root/.xauth8oJjfo
xauth:  timeout in locking authority file /root/.xauth8oJjfo
xauth:  timeout in locking authority file /root/.xauth8oJjfo

Authentication failed - cannot start X server.
Perhaps you do not have console ownership?giving up.
xinit:  No such file or directory (errno 2):  unable to connect to X server
xinit:  No such process (errno 3):  Server error.
xauth:  timeout in locking authority file /root/.xauth8oJjfo
[root@host ~]#


=\

Northsoft ★★
() автор топика
Ответ на: комментарий от Northsoft

Удали старые файлы авторизации перед запуском :)

fluorite ★★★★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.