su subshell

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



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

If not speficying "-", everything works fine:
[root@stone]# su joe -c ls
Desktop Music

Any ideas? Am I missing something?

Thanks in advance,
To unsubscribe from this list: send the line "unsubscribe linux-config" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at

[Index of Archives]     [Audio]     [Linux Console]     [Hams]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Samba]     [Fedora Users]

  Powered by Linux