We help IT Professionals succeed at work.

remote command execution using cygwin/sshd

vikky999
vikky999 asked
on
2,185 Views
Last Modified: 2012-08-14
okay i need to start outlook on 2 remote windows machines (Win1 and Win2).
The 2 machines are part of a domain and have cygwin/sshd installed.

So i ssh in to the 2 machines remotely from a third machine Win3, and try to start outlook by executing
cmd /c "OUTLOOK.EXE"

here is hte problem, outlook doesnt start properly, ive narrowed the problem down to the fact that although i login via ssh as administrator on both win1 and win2, if i do a cmd /c "WHOAMI.EXE" it shows
NT AUTHORITY/SYSTEM

instead of
MyDOMAIN\Administrator

how do i make cygwin user the user credentials of the remotely logged in user i.e MyDomain\Administrator to start Outlook
Comment
Watch Question

Author

Commented:
Ive done the usual ssh-host-config, mkpasswd -l -d > /etc/passwd, and mkgroup -l -d > /etc/groups etc.

I realise there is a possiblity of conflict between the local machine\Administrator and MyDomain\Administrator accounts, so after creating /etc/passwd. I rename the local Machine\Administrator to local machine\local admin.

Nothing works...ive been trying to do this for 3 days nearly day and night now..nothing works..

I need to run it as a service unfortunately and cannot run it under a user account. The even stranger thing is that on another machine that i have the whole thing works correctly. If i login as SomeDomain\Administrator, and do a cmd /c "WHOAMI.EXE". it correctly displayed SomeDomain\Adminsitrator.

However that machine wasnt setup by me.

If i try a fresh cygwin/sshd install of any other machine....everythwere after loggin in form a remote machine as a domain user is cmd /c "WHOAMI.EXE" always shows
NT AUTHORITY/SYSTEM

Author

Commented:
oh yeah and i also did check "Interact with desktop" in the Control panel->Administrative services->Cygwin sshd->properties
Where do you expect outlook to be displayed?
Are you aware that modern windoze nerver managed to run a program on hostA with display on hostB (as X does since decades)?

Author

Commented:
I want Outlook to be displayed on the remote hosts, so if i ssh from win3 to win1 and run outlook, outlook should run on win1. basically after sshing into a box i want the ssh ssh shell to behave exactly like a local shell on win1.

> ..to be displayed on the remote hosts,
AFAIK you cannot start any GUI (at least it will not it will not be vissible)

> .. basically after sshing into a box i want the ssh ssh shell to behave exactly like a local shell on win1.
nice idea
but not possible with windoze, unfortunately, you better switch to something reliable (Linux, Unix, VMS, ...:)

Author

Commented:
hmm...well the funny part is it works on one of my windows macihnes and doesnt work on the other hence the question to get to the bottom of this.

infact it works on the other machine also, but thats only if i dont start it as a service but start it like a normal program after logging as that user into windows
do you mean that it works if the sshd is started as the same user which then connects from remote?

Author

Commented:
Say i have administrator@somedomain
I login as administrator@somedomain on a windows machine (NOTE: not local administrator)
i then start sshd, not as service but by /usr/sbin/sshd in cygwin bash shell

if i now connect to this machine via ssh and login as administrator, then everything works smoothly !
and a window whoami shows me as logged in as somedomain\administrator

however if sshd is run as a service, then logging in as administrator , whoami show
NT AUTHORITY/SySTEM
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
IMHO the question has been answered after some clarifications, no reason for a delete/refund

Author

Commented:
nope..i disagree. this solution is not allright for a simple reason, that i dont want to start sshd as a particular user. it runs as local system on one of my machines and works correcly, i just want to replicate the same on a different machine.
as I read this thread I explained in htp:#20498028 why it won't work, this has been confirmed in http:#20503434
hence initial questioned answered, or do I miss something?
"cannot be done" is a valid answer too
CERTIFIED EXPERT

Commented:
Force accepted.
modus_operandi
EE Moderator

Author

Commented:
i still disagree ...."cannot be done" is a totally valid answer, except that i have a windows machine on which this works correctly , so it definitely can be done.

> .. have a windows machine on which this works correctly ..
of corse, 'cause all windoze-specific conditions (like user) match, as you explained yourself

Author

Commented:
i cant argue unnecessarily anymore. go ahead take your points. i will give them to you gladly, but i repeat my question is not answered since i dont wish to start the service under the "user"s account permissions but under "nt authority" users permissions as it works on one of my windows machines and not on another.

Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.