http://groups.google.de/group/comp.unix.shell/browse_frm/thread/1aabaddbf9215d81/0398881066c2d757<br class="khtml-block-placeholder">
if [ "$DISPLAY" != "" ]; then
echo Login via X
else
if [ "$SSH_CONNECTION" = "" ]; then
echo Login via su
else
echo Login via ssh
fi
fi
$ echo $0
-bash
$ su -
Password:
# echo $0
-su
ps $$|grep -q -- ' -su'&&echo SU <br>
[ "$0" = "-sh" ] && echo SU <br>
Compare "who am i" with "id".<br>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment