How ansible copy file from remote windows to remote linux without local copy and ssh install in windows - linux

OS: Wk16 vs Debian 10.4
Ansible: 2.9
Hi all
I need to send a file from remote Windows to remote linux without to copy in local without to install ssh package in Windows server.
A Win_server <-- Ansible role executor -- B Ansible_host C linux_host
|
| ^
|___SENDING FILE_______________________________________TO___________|
Thank's a lot

Checkout syncronize module at Ansible Documentation: https://docs.ansible.com/ansible/latest/collections/ansible/posix/synchronize_module.html
Also, be aware to stablish direct ssh connection between targets.
Hint: It's possible to activate ssh on windows and stablish connection to the linux machine. Take care of the risks!
Other way is to use fetch and copy to do the triangle copy using Ansible server as elbow.

Today I putted the SSH in Windows how #guistela sayed.
I Installed "Posh-SSH" on Windows host with ansible:
Manual Download from:
https://www.powershellgallery.com/packages/Posh-SSH.
Send file to Windows host contains files to send.
Install with microsoft steps: Installing PowerShell modules from a
NuGet package.
Possh-SSH use commands, more info here:
powershell-scp-to-transfer-files-between-windows-linux:
Open ports
Send file
Close ports
This 4 general steps permits send files from windows to linux hosts.
Cordially

Related

remote command on windows from 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

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

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.

Resources