Originally posted by: SystemAdmin
Hi,
Really need some aix gurus to help me on this issue, here is the scenario.
Running AIX53TL07SP1 or AIX53TL07SP4, all run by root.
1. Create a K-shell script called su-test under /tmp as below, change to excutable after vi.
#!/usr/bin/ksh
/usr/bin/su - users
2. go to /tmp and run the script.
./su-test
sometimes, the script would work and lead me to /home/users, but sometimes, it also works, however, the sub-shell would close right away and back to root.
So question here is :
What's the difference between run su command directly and run that script? since if I run su command directly, I would not have this issue at all.
Any feedback is really appreciate.
Here is more tech details for environment:
Running openssh on the server, if we use console login by root directly, the script would work fine.