From: Joe <longapple@gmail.com>
To: linux-config@vger.kernel.org
Subject: su subshell
Date: Fri, 18 Sep 2009 04:34:26 +0800 [thread overview]
Message-ID: <56b13acf0909171334w6357000fm690d63bab4c37bb5@mail.gmail.com> (raw)
Hi,
I met a strange behavior of su command with "-". I login my host as
root and want to run some command with normal user, say joe. Here is
what I see:
[root@stone]# su - joe -c ls
[joe@stone]$ <===== Instead of
list the files under this directory, the shell login the account joe
[joe@stone]$ exit
Desktop Music <===== When I type
exit in the subshell, it prints the output of "ls" command and then
return to root
[root@stone]#
If not speficying "-", everything works fine:
[root@stone]# su joe -c ls
Desktop Music
[root@stone]#
Any ideas? Am I missing something?
Thanks in advance,
Joe
reply other threads:[~2009-09-17 20:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=56b13acf0909171334w6357000fm690d63bab4c37bb5@mail.gmail.com \
--to=longapple@gmail.com \
--cc=linux-config@vger.kernel.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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).