Using cygwin I want to use let say ls command as a root user its is working fine as below
ssh -l myid test.com
TEST /home/myid -> /usr/local/bin/sudo su -
TEST / ->#ls -ali
-rw-rw-r-- 1 root system 0 Dec 4 1997 .SQLin_AEu_
-rw-rw-r-- 1 root system 0 Dec 3 1997 .SQLinQFpo
-rwxr----- 1 root system 1412 Oct 25 1999 .alias
but when I use ssh command in one line does not work (no out put from ls command)
$ ssh -l myid test..com 'id;export TERM=cygwin;/usr/local/bin
/sudo su -; ls;id
uid=2005(myid) gid=1(staff) groups=0(system),2(bin),7(
security)
** at this point I am root but there is no out put for ls or id **
please note as I have mention before there is no out put from above command for ls or id command as root but if I manually type the ls or id command it will work but that is not I want I want this command to work,
($ ssh -l myid test..com 'id;export TERM=cygwin;/usr/local/bin
/sudo su -; ls;id
Start Free Trial