I have created a VB.NET program using windows forms. The program runs on a remote PC and displays information on a screen. The computer does not even have a mouse or keyboard connected to it. The program shows the information based on the file that is loaded.
I want to be able to change this file remotely to another file that is already on the remote PC. I can't use a graphical remote desktop client as we have very limited bandwidth.
So, my idea is to change the file using the command prompt (I think I'll need something like SSH). I'm not sure how to do this. Should I use something like this and load DosModule first:
Module DOSModule
Public Sub Main()
Console.Write("First, start with Command Prompt processing ...")
Dim myWinForm As New WinForm
Application.Run(myWinForm)
End Sub
End Module
How would I then read commands that is send to the program? I also only want one instance of the program running.
Thanks
You have 2 options. The first is a custom program that WILL require some network programming, like it or not. I would suggest creating either a Command-Line batch file or else a PowerShell script, then creating a program to transfer the script to the remote computer and execute the script.
The second option and the one better suited for you would be to download an SSH server. An SSH server will essentially open a command window and pipe the input and output over to a telnet client running on your machine. If you are running a version of Windows Server, an SSH server comes with Windows Server. Otherwise, you can download one for free here: http://www.freesshd.com/
Once you install the SSH server, you simply use telnet, from a command prompt, to link up with your remote SSH server
Related
I connect to a server within Visual Studio Code using SSH ("Remote-SSH: Connect to Host..."). When working in the terminal within VS Code, the command code <file> results in opening the file in VS Code of the client (therefore on my screen). Now let's suppose I establish another SSH connection from the current session to a workstation within the network of the server using ssh <some workstation>. When I now try to open a file in VS Code using code <file>, nothing happens.
My questions are:
Since the last code <file> mentioned didn't open anything on my screen, is it possible that VS Code did open on any other screen connected to either the server or the workstation?
Is there any possibility to open the file within my VS Code?
As for your first question:
There's is NO WAY your action could have opened a window on any other screen than yours. For that to happen you'd have to "link" your ssh session to that screen, which would require a bunch of intermediary steps.
Now for the second question:
Yes its possible (and pretty easy). BUT you will have to open another session of VScode that will connect to the "workstation" through the server.
Currently, to connect to the server, you probably had to add these lines to your ssh config file:
Host MyServer
HostName adress.server
User username
To open a session in the workstation, through the server, you should add these lines:
Host MyWorkstation
HostName workstation.adress.within.network.of.the.server
User usernameInWorkstation
ProxyJump server.adress
I need to SSH a remote machine and get onto the developer mode. To be specific, I want to execute the command 'Ctrl+gog' upon which I will be prompted for a password. I know how to execute the normal commands, for example chan.send("enable\n"). Please provide me with an answer.
chan.send("\x07\x0F\x07")
Above command worked fine for me.Just concatenate the Hexa equivalent for Ctrl-g,Ctrl-o,Ctrl-g which is, x07x0Fx07.
I made a simple binary application like a clock and run it in server but when I close ssh connection,application will be closed.
But i want clock run all the time for example.
Then I made a simple service and I want to run it in server but I do not know how install,control and resume it after I close ssh connection.
Try adding an & after it to put it into the background, then you can close your ssh session and leave it running. You could also (if the binary is in git) use an action hook to run it (but you still need to include the &), something like..
$OPENSHIFT_DATA_DIR/clock &
If it was located in your $OPENSHIFT_DATA_DIR directory.
I am trying to use telnet to copy file from a remote location which happens to be Windows Phone 8 device.
I am using the below 2 commands.
telnet 127.0.0.1 1023 -f C:\Documents\fpsnum.txt
type "C:\Data\Users\local\log.txt"
Manually this runs fine but I require to run this through automation. I tried placing these commands in testcase.xml but it doesn't intend to do what it could manually.
I have also tried using bat file to run these 2 commands but the bat file could only launch a telnet session it couldn't execute the second command.
Any idea/suggestions to work this out?
Telnet is meant to be an interactive terminal so it probably won't work this way.
You could use a program like "socket" or "nc" to open a raw TCP session to the server port and send the command that way, capturing the output. That would allow your automation but note that the "telnet protocol", if it is actually in use, will include extra handshake bytes at the start. They're easy to strip out, though, and may not even be there depending on the OS and the program listening on that port.
I am looking for a tool that will allow me to monitor and control programs running inside a Windows VM from the Linux host machine. I realize that this is similar to what a rootkit would do, and I am completely happy to use some hacker software if it provides the necessary functionality (and if I can get it in source-code form).
If I can't find something, I'll have to write it using C. Probably an embedded HTTP server running on an odd port and doing some kind of XMLRPC thing.
Here is the basic functionality I need:
Get list of running processes
Kill a process.
Start a process
Read/write/create/delete files
I would like to:
- Read contents of screen
- Read all controls on screen.
- Send arbitrary click to a Windows control.
Does anything like this exist?
Build Samba with WMI support from http://dev.zenoss.org/svn/trunk/inst/externallibs/wmi-1.2.9.tar.bz2. Not in the official Samba yet.
Get list of running processes
wmic -UAdministrator //host "select * from Win32_Process"
Kill a process
You need to run wmic on the Windows host using winexe because Samba wmic only supports querying
winexe -UAdministrator //host "wmic process where name=\"process.exe\" delete" # Kill process.exe
winexe -UAdministrator //host "wmic process where ProcessId=145 delete" # Kill pid 145
Start a process
winexe -UAdministrator //host process.exe
Read/write/create/delete files
You probably want to use Samba read man mount.cifs and man smbclient