Steps to transfer file from One Windows Remote Server to another Windows Remote Server using OS Process Sampler in JMeter - ssh

I have transferred or copied a files from local machine to Server successfully using OS Process Sampler but unable to transfer a file from One remote server to another remote server on windows.
Can anyone explain me the process or share the steps or command which are being used to do the same.
Thanks

If you have OpenSSH servers on both machines you can use SSH Command sampler to execute scp command for transferring a file from one remote machine to another remote machine
In case of Windows you might have to provide the full path to scp.exe binary like:
C:\Windows\System32\OpenSSH\scp.exe
The exact configuration may differ depending on source/destination paths, whether public key authentication is enabled or not, etc.
Also SSH Command sampler doesn't come with JMeter, you will need to install it as a part of SSH Protocol Support bundle using JMeter Plugins Manager

Related

Secure tunnel from SSH server to target host

My java application connects to an SSH server and runs a third party utility by ChannelExec of Jsch. Then, this application makes unsecured/uncompresed file transfer to another server on which an SSH server is installed.
The flow is:
JavaApplicationHost --> SSHServer1(3rd party utility runs) --> SSHServer2
I want file transfers between these SSH servers to be secured/compressed. But, I cannot use any platform dependent utilities such as ssh command. I cannot install anything on these SSH servers. I just can use JSch to these SSH servers.
Is there a way to secure/compress communication between these SSH servers by JSch or any other alternatives ?
Thanks in advance!
There is a jump host example of Jsch at http://www.jcraft.com/jsch/examples/JumpHosts.java.html that cascades multiple JSch sessions.
The flow can be:
JavaApplicationHost --(JSchSession1)--> SSHServer1(3rd party utility runs) --(JSchSession2)--> SSHServer2
If I can create another tunnel by JSchSession2 between these SSH servers, I will be able to secure/compress the 3rd party application.
I will test and update here.
Thanks!

How to write to remote linux directory

How to expose a directory in remote ubuntu server so that I can read & write to that directory from remote machines.
Actually, I have a web application and I need to write to the AWS EC2 instance's directory and create directories using java program running in another server.
Note: I do not want to run a java program in AWS instance just for writing files.
Thanks in advance
I think you can use sftp from Java: https://www.example-code.com/java/sftp.asp or https://kodehelp.com/java-program-for-uploading-file-to-sftp-server

Where are TLS certificates stored for Docker on Windows Server 2016 TP3

I have a VM running Windows Server 2016 Technical Preview, and have installed the Containers feature, and then run the Install-ContainerHost.ps1 script from Microsoft's container tools repo
https://github.com/Microsoft/Virtualization-Documentation/tree/master/windows-server-container-tools/Install-ContainerHost
I can now run the Docker Deamon on Windows. Next I want to copy the certificates to a client machine so that I can issue commands to the host remotely. But I don't know where the certificates are stored on the host.
In the script the path variable is set to %ProgramData%\docker\certs.d
The certificates on windows are located in the .docker folder in the current user directory.
docker --help command will show the exact path details
AFAIK there are no certificates generated when you do what you are doing. If you drop certificates in the path you found then it will use them, and be secured. But otherwise there is none on the machine. Which explains why it isn't exposed by default.
On my setup I connected without TLS but that was on a VM that I could only access on my dev machine. Obviously anything able to be accessed over a network shouldn't do that.
Other people doing this are here: https://social.msdn.microsoft.com/Forums/en-US/84ca60c0-c54d-4513-bc02-14bd57676621/connect-docker-client-to-windows-server-2016-container-engine?forum=windowscontainers and here https://social.msdn.microsoft.com/Forums/en-US/9caf90c9-81e8-4998-abe5-837fbfde03a8/can-i-connect-docker-from-remote-docker-client?forum=windowscontainers
When I dug into the work in progress post it has this:
Docker clients unsecured by default
In this pre-release, docker communication is public if you know where to look.
https://msdn.microsoft.com/en-us/virtualization/windowscontainers/about/work_in_progress#DockermanagementDockerclientsunsecuredbydefault
So eventually this should get better.

Transfering file to remote server behind a gate node with key authentication disabled - and compiling

I'm working on a project that requires me to run my code on a remote Unix server, that is not available to connect to directly (you first have to log in to the "gate" node and then to this server).
What's really bad is that they disabled key authentication, so each time I need to ssh into it, I have to type in my password twice. It's really annoying and I wonder what's the best way to transfer my local modifications of source files to this server, compile and run them without having to provide those passwords so many times.
I have no sudo access to any of those servers (neither to this "gate", nor to this target server). Any ideas on how to make the whole process more efficient?
EDIT: Martin Prikryl provided a great answer below, but it's suitable for Windows and I'm on a Mac :) I guess it might be a good thing to have it documented here also for *NIX systems.
You are looking for SSH tunneling.
WinSCP SFTP client supports one-hop SSH tunneling natively.
See the Tunnel page on WinSCP Advanced Site Settings dialog.
I assume that after you transfer the file, you need to open SSH terminal to compile the file.
You may be able to make use of WinSCP Console window for that step.
Alternatively, if you need/want to use a real SSH terminal client, make use of an existing SSH tunnel, created by WinSCP, and connect with PuTTY (or any other SSH client) over it.
In the Local tunnel port of WinSCP Tunnel page, select a fixed port number (instead of the default Autoselect). In PuTTY enter "localhost" to Host Name and the selected port in Port.
(I'm the author of WinSCP)

Running Jmeter remotely from command line

Is it possible to run Jmeter on remote server without having Jmeter client on local machine.
I mean can I just run jmeter.bat on remote machine from command prompt, so that it just run tests on remote server and store results in listener.jtl file over there, without any jmeter client on my machine.
Here is the link: http://jmeter.apache.org/usermanual/remote-test.html.
Just go through the documentation available in the Jmeter's website.
The scenario given by you is some sort of "distributed testing" itself, where you want every tester to execute load testing from the machine where JMeter is installed.
For this purpose you must copy JMeter in each testers machine and make the entry of your JMeter server machine (Host Machine).
Now when every tester will run JMeter they will be able to run the load on the JMeter Host Machine.
jmeter -n -t script.jmx -l listener.jtl -R HostMachineIP