Python Lib to excute remote windows commands from a linux Box without using ssh - linux

This a very basic requirement of our project.
I need to run Windows command from a linux box, without using ssh, as not all the windows boxes have ssh installed by default.
I was searching for some python libs that can do this work?
Links, tutorial, are highly appreciated.

Some alternatives:
http://www.krenger.ch/blog/wmi-commands-from-linux/
http://pypi.python.org/pypi/WMI/ (under wine or a Windows bridge VM)
https://code.google.com/p/impacket/source/browse/trunk/examples/psexec.py

Related

How to open a VS Code IDE from Linux subsystem on Windows?

I'm running a Linux subsystem with an Ubuntu terminal inside Windows 10 - I wanted to make use of the functionalities of both operating systems without partitions or virtual machines.
In an Ubuntu terminal on Linux, I use the command 'code .' to open up the VS Code IDE but it doesn't seem to work when the terminal is part of a subsystem on Windows.
I can open up the IDE from Windows 10 and set my path into the Linux system but I remember reading some guidance that it's okay to save files from the Linux onto the Windows side but not vice versa.
Any solutions are much appreciated, thanks in advance!
If you wish to invoke windows binaries from WSL (Windows Subsystem for Linux) like for the example you want to run visual-studio-code, you can do so by setting your visual-code's installation directory into your %PATH% system variable and invoking it using this way
$ [application-name].exe notice the .exe is important.
And this interoperability is added in the Fall Creator Update of windows.
You can follow this documentation from Microsoft for more help.

Git bash and x-win32 will work together for running linux applications remotely?

usually, school recommends using PuTTY with X-win32 to access and run linux software remotely on a window machine.
PuTTY is basically a tool to SSH into the linux machine from my understanding. Since I need to use github on my windows as well, git packages its own bash shell as a whole of git, so can it work with x-win32? I dont want to have two bash shell running just for convenience.
If it does, how to set it up? Anything different from setting up Putty?
Thanks!

Remote coding in linux from windows

I have a ubuntu machine in the same network with my windows laptop. I have a Pycharm Community Edition in my windows machine. I want to use the Pycharm in my windows machine to write Python Scripts which I want to run in Python interpreter present in Ubuntu machine. I am having difficulties installing Samba, as a linux newbie. I get the error that says samba.conf not present.Is there any other alternatives?
Don't bother with Samba. You can configure PyCharm to directly upload changed files to a remote server. I.e., when you save locally on your Windows workstation, it can automatically ftp/sftp the file to a pre-configured location on your remote server. See configuration instructions here:
https://www.jetbrains.com/pycharm/help/creating-a-remote-server-configuration.html
I used this when I set up my LAMP machine a few years ago:
https://www.howtoforge.com/ubuntu_debian_lamp_server

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.

How to copy files from windows to linux (cross platform)?

I want to trigger command/script from Linux environment which copies file from windows system to my Linux environment.
I have set up local Linux server for my web application. I am using WinSCP for file transfer and Putty as a console.
I want to automate the process of build deployment of Linux server.For that i have to copy build which is on my windows machine and paste it in my local Linux server so that i can deploy it.
As per my understanding, there should be some shared location which is accessible from Linux environment.
Is there is any script available for this? Also, please tell me the configuration changes require to do this.
You can use synchronize command of winscp from your windows,
winscp synchronize command
or winscp.exe command from your command prompt.
winscp.exe command
Install cygwin and you can use scp, ssh etc just like you would on linux. Besides, you can use ordinary bash scripts instead of crappy bat-files.
OR
http://www.codingepiphany.com/2014/01/13/batch-script-for-transferring-files-from-windows-machines-to-linux-file-server/
OR
Use samba
you can use rsync for synchronize your files. http://linux.die.net/man/1/rsync

Resources