I run this SSH command from server1 on server2 :
ssh server2 echo pasword | su - root -c "echo this is the `hostname`"
I expected the result to be host name of server2 but instead I get host name of server1. How can I manipulate the command to get the hostname of server 2 ?
Thanks.