URL: https://www.opennet.me/cgi-bin/openforum/vsluhboard.cgi
Форум: vsluhforumID1
Нить номер: 63204
[ Назад ]

Исходное сообщение
"Как рутом запустить команду от юзера user?"

Отправлено universite , 08-Янв-06 19:30 
У пользователя user указан шелл /bin/noexist
su user ессно не проканает :)

Содержание

Сообщения в этом обсуждении
"Как рутом запустить команду от юзера user?"
Отправлено dm , 08-Янв-06 20:04 
>У пользователя user указан шелл /bin/noexist
>su user ессно не проканает :)

man su

во фре

su -m games -c 'touch file'


"Как рутом запустить команду от юзера user?"
Отправлено universite , 08-Янв-06 20:51 
>>У пользователя user указан шелл /bin/noexist
>>su user ессно не проканает :)
>
>man su
>
>во фре
>
>su -m games -c 'touch file'

#su -m user -c 'pine'
The "/root/mail" subdirectory already exists, but it is not writable
by Pine so Pine cannot run.  Please correct the permissions and
restart Pine.

но
#su user
$pine
работает...


"Как рутом запустить команду от юзера user?"
Отправлено dm , 08-Янв-06 21:29 
>>>У пользователя user указан шелл /bin/noexist
>>>su user ессно не проканает :)
>>
>>man su
>>
>>во фре
>>
>>su -m games -c 'touch file'
>
>#su -m user -c 'pine'
>The "/root/mail" subdirectory already exists, but it is not writable
>by Pine so Pine cannot run.  Please correct the permissions and
>
>restart Pine.
>
>но
>#su user
>$pine
>работает...

man su !!!

-m      Leave the environment unmodified.  The invoked shell is your
        login shell, and no directory changes are made.  As a security
        precaution, if the target user's shell is a non-standard shell
        (as defined by getusershell(3)) and the caller's real uid is non-
        zero, su will fail.
EXAMPLES

     su man -c catman
     Runs the command catman as user man.  You will be asked for man's
     password unless your real UID is 0.

     su man -c 'catman /usr/share/man /usr/local/man /usr/X11R6/man'
     Same as above, but the target command consists of more than a sin-
     gle word and hence is quoted for use with the -c option being
     passed to the shell.  (Most shells expect the argument to -c to be
     a single word).

     su -c staff man -c 'catman /usr/share/man /usr/local/man/usr/X11R6/man'
     Same as above, but the target command is run with the resource
     limits of the login class ``staff''.  Note: in this example, the
     first -c option applies to su while the second is an argument to
     the shell being invoked.

     su -l foo
            Simulate a login for user foo.

     su - foo
            Same as above.

     su -   Simulate a login for root.


"Как рутом запустить команду от юзера user?"
Отправлено universite , 09-Янв-06 00:17 
Прошу извинить меня. Невнимательно маны курил...