[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

su subshell



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
--
To unsubscribe from this list: send the line "unsubscribe linux-config" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Site Home]     [Audio]     [Hams]     [Kernel Newbies]     [Memory]     [Security]     [Netfilter]     [Bugtraq]     [Writing Drivers]     [Photo]     [Yosemite Photos]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linux Resources]     [Fedora Users]
Add to Google Powered by Linux