remote command on windows from linux - linux

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.

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

Related

Is it possible to execute sh files GUI application from linux remote server and view it on local machine?

I have a job that runs denodo platform on remote server. Sh files is a GUI application, and I have to run it to start denodo service. I can't access it in windows, is there a way to solve these problems?
Already running sh files on Putty Windows, but only return null.
If it's a linux GUI application, you should "export display" to view the server screen on your workstation.
Depending of your workstation linux distribution, it might be as easy as :
xhost +<IP_address_of_workstation>
./runMyApp.sh
As your workstation is running windows operating system, you have do further configuration :
https://superuser.com/questions/325630/how-can-i-export-display-from-a-linux-terminal-to-a-windows-pc
https://seanthegeek.net/234/graphical-linux-applications-bash-ubuntu-windows/
If your workstation is connected through SSH you need even more configuration as discussed here : https://unix.stackexchange.com/questions/12755/how-to-forward-x-over-ssh-to-run-graphics-applications-remotely
You can run GUI-Applications of remote linux host in a windows client via ssh (putty) with x-forwarding and an installed x-server (xming)
See this question:
https://superuser.com/questions/299158/how-to-make-putty-do-the-equivalent-of-ssh-x

copy /move the Data from the Linux Command line to local windows

Installed CYGWIN in my windows, I can able to access both windows & remote linux machines with the credentials. But i can't able to configure how the data will be moved from Linux to windows, can anyone please suggest me on this.
Thanks
Srinivas
To log into your cygwin instance remotely, you need to install the sshd module in cygwin and then set it up. Then you will be able to use the ssh command on your linux/unix machine to do one of many things:
open a bash shell in your cygwin instance
execute a remote command from linux/unix using: ssh WINDOWS_SERVER command
copy to the Windows machine remotely using scp or sftp.

Accessing VPS linux hosting like RDP in Windows

Sorry but I'm a newbie in Linux. I have a VPS hosting of CentOS 6. Can I access it like Remote Desktop on windows to see the GUI?
With a hosted Linux machine chances are that id doesn't even have "the GUI" (an X11 server and some GUI environment like KDE or Gnome) installed at all but only supports command line access via ssh.
If you really need GUI instead of command line access then the "classic" option would be VNC. There is a HowTo for this for CentOS at
http://wiki.centos.org/HowTos/VNC-Server
or at
http://www.howtoforge.com/vnc-server-installation-centos-6.5
for example ...

FTP and execute shell scripts on windows from linux

I'm trying to run automatic tests using Jenkins and I want to execute commands from my Jenkins server, which is a Lenny-64 on another virtual machine with Win7. To be clear, if I wanted to do it via two Unix machines, I would have done it using this:
ssh -i private_key python /root/test.py
Now, what is the alternative command for a windows target machine, or what should I deploy to run this on a windows machine.
Plus I want to transfer files from/to Jenkins server to/from Win7 machine.
How can I do these tasks?
I've been working around and I solved the issue. I installed cygwin with openssl and openssh libraries. For connections, I used RSA keys and for websvn commands, I used Tortoise SVN tool along with its command line.

How to shutdown a Windows Server 2003 machine remotely usin C#?

I want to shutdown/reboot a Windows Server 2003 machine remotely using C Sharp. I have the Administrator credntials. This app will be ran from local machines also on the LAN.
I have tried so many examples on the internet, and none appear to work :(
Instal PsShutdown app from sysinternals link package and then use your code to call it like:
Process.Start("psshutdown.exe","-h -u "Login" -p "Password" \\PCNAMEORIP");
That's the simplest way i can suggest.

Resources