Advertisement

06.02.2005 at 05:40PM PDT, ID: 21445369
[x]
Attachment Details

using ssh sudo command

Asked by lonaj in IBM AIX Unix

Tags: , , ,

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
[+][-]06.03.2005 at 06:04AM PDT, ID: 14139089

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: IBM AIX Unix
Tags: sudo, command, cygwin, ssh
Sign Up Now!
Solution Provided By: Gns
Participating Experts: 1
Solution Grade: A
 
 
[+][-]06.03.2005 at 06:06AM PDT, ID: 14139100

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32