-1

I want to run windows command on windows 2003 server from RHEL machine.

I tried one way to do it using winexe and it is working as expected. However to do this one I have to keep 139 port open and apparently this is a very vulnerable port and is advised not to be kept open. One other way I found was to use cygwin and open ssh packages but these are again not supported in windows 2003 server.

Can anyone please suggest me any other way leaving these 2 to connect linux and windows machine and run command on cmd.exe from linux terminal.

  • See also [this](https://stackoverflow.com/a/46926540/841108) answer to a similar question; it could help you improve your question (which, without any [MCVE] is probably off-topic here) – Basile Starynkevitch Oct 27 '17 at 07:00
  • very vague answer. moreover I want to run some commands not a .bat script. – shrawani karpe Oct 27 '17 at 07:06
  • 1
    But it shows that you need to ask your question in terms of protocol, client, server, service (which you do not). And even improved, your question is off-topic here; https://superuser.com/ might be a better place to ask (but you still do need to think in terms of protocol, client, server, service). – Basile Starynkevitch Oct 27 '17 at 07:10
  • BTW, what makes you think that using the 139 TCP/IP port is bad? Please elaborate. And on the Windows machine, it would be the responsibility of its sysadmin. In some situations it could be ok, so ask him. – Basile Starynkevitch Oct 27 '17 at 07:15
  • A possibility might be to use some more secure protocol, but you don't ask about that, and we don't know how remote or distant is the Windows server (same local network, in the same room, behind a common firewall, or intercontinental access thru the Internet). – Basile Starynkevitch Oct 27 '17 at 07:22
  • There's one more option - `wine` command. I'm not sure about the Security features, though. [Check this](https://wiki.winehq.org/List_of_Commands) – mathB Oct 27 '17 at 07:37
  • 1
    there a plenty commercial ssh-server products available. some of them free for personal use – mbieren Oct 27 '17 at 07:47

1 Answers1

1

You can emulate the whole Windows on RHEL using the Wine software. So you won't need to connect anywhere.

Other option is to connect from RHEL to Windows 2003 Server via an SSH.

Installing of an OpenSSH server on Windows has a couple of quirks:

  • in Windows settings you have to allow your account to run services

  • in the sshd config file of the OpenSSH server you have to set the StrictModes option to no, so you can use the SSH authentication by public/private keys

Velkan
  • 7,067
  • 6
  • 43
  • 87