1
Open Connection    192.***.***.**
Login    ****    *******
Start Command    su hdfs
Execute Command    cd /home/rajesh/hive-latest/
${STDOUT1}    Execute Command    ls -lrt
Log    ${STDOUT1}
Close Connection

*Here i am able to login. after login, not able to switch to super user. without switching to super user, its executing ls -lrt. Please help me with this if anyone knows

1 Answers1

0

This is not how the ssh library works. Have a look at the documentation

The command is always executed in a new shell. Thus possible changes to the environment (e.g. changing working directory) are not visible to the later keywords

You can work around this by executing the command as different user, or if possible you can open another connection and login as desired user.

su - <username> -c "<commands>"
Jiri Janous
  • 1,189
  • 1
  • 6
  • 14