From: Peter Volkov <pvolkov@mics.msu.su>
To: ALT Linux Community <community@lists.altlinux.org>
Subject: Re: [Comm] Ошибка в man su?
Date: Thu, 22 Dec 2005 23:17:42 +0300
Message-ID: <1135282663.21009.8.camel@localhost> (raw)
In-Reply-To: <43AAFC05.1020205@mail.ru>
[-- Attachment #1: Type: text/plain, Size: 2555 bytes --]
On Чтв, 2005-12-22 at 22:18 +0300, Dmitriy Khanjin wrote:
> По умолчанию вызывается непосредственно оболочка пользователя, однако,
> при указании флага аргумента -, su вызывает оболочку регистрации в
> системе. Это значит, что текущий рабочий каталог будет изменён в
> домашний каталог нового пользователя и первый аргумент оболочки будет
> иметь префикс -. Это поведение понятно и обрабатывается большинством
> командных интерпретаторов. В случае вызова оболочки регистрации в
> системе, любая команда, передаваемая посредством аргумента -c, будет
> проигнорирована.
Хм. У меня такого не написано. Скорее всего перевод не верный.
su is used to become another user during a login session. Invoked
without a username, su defaults to becoming the super user. The optional
argument - may be used to provide an environment similiar to what the
user would expect had the user logged in directly.
Additional arguments may be provided after the username, in which case
they are supplied to the user's login shell. In particular, an argument
of -c will cause the next argument to be treated as a command by most
command interpreters. The command will be executed by the shell
specified in /etc/passwd for the target user.
Кратко.
Флаг - говорит, что вы получите окружение (environment) такое же как
если бы залогинились напрямую.
Аргументы после имени пользователя передаются напрямую командному
интерпретатору. В частности, аргумент -c заставит shell интерпретировать
последующий аргумент как команду.
> Разве?
> Я ж могу сказать su - -c mc и получить mc для рута.
Конечно можете. Но надо будет только подтвердить что вы достойны быть
рутом введя соответствующий пароль ;)
Peter.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2005-12-22 20:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-22 19:18 Dmitriy Khanjin
2005-12-22 19:42 ` Michael Popov
2005-12-22 20:56 ` Dmitriy Khanjin
2005-12-22 20:17 ` Peter Volkov [this message]
2005-12-22 22:03 ` [Comm] � Dmitriy Khanjin
2005-12-24 16:39 ` [Comm] Re: ? Andrei Lomov
2005-12-24 16:38 ` [Comm] Re: Ошибка в man su? Andrei Lomov
2005-12-25 8:31 ` Aleksander N.Gorohovski
2005-12-25 9:19 ` Dmitriy Khanjin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1135282663.21009.8.camel@localhost \
--to=pvolkov@mics.msu.su \
--cc=community@lists.altlinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git