Transfer of file from one machine to another machine - ftp

There are 2 machines on a network on which GUI is not installed to save the memory. Transfer a file from 1 such machine to another similar machine.
Possible methods I think could be
1. If we can the other computer on the network, we can put the items into a "shared" folder (or making an existing one "shared').
2. Using the ftp protocol on the command line and connecting to one of the machines acting as ftp server and downloading files from that using command 'get' to download the file
3. Create a TCP connection across the two machines. One machine which is having the file will read it and write it to the socket and another one will read it from the socket.
Could there be more solutions for this?

The usual solution is to use SCP to transfer files using a SSH connection.

Related

ESP32 OTA updates via FTP to EFS module

I'm currently on the process of developing an OTA firmware update of a datalogger's esp32 board via a FTP and an EFS module. Since all of the dataloggers I'm working with are in an area where there's no wifi coverage and can't use traditional OTA.
The idea is to use the AT commands of the sim5320 of the datalogger to transfer the binary file via a FTP server using an EFS module and then transfering the file to my esp32. I'm using an EFS module because I tried transfering the file with filezila client and can't send files bigger than 500 bytes, which made the task not at all pragmatic since my file is around 300kb.
I found this AT command that does the task: "AT+CFTPGETFILE Get a file from FTP server to EFS" but I have little idea as to how to implement it.
Has anyone done this before or knows how to implement it?

How to performant connect a FTP Server to a Webdav Server?

I have implemented a webdav directory in PHP using Sabre DAV, for my website (Application Server Webinterface).
For this Website I am writing now an TCP Socket using C#, which is running on another server (actualy it is in the same datacenter, but for theoretical sake, it is on the other hemisphere).
The Socket actualy is a service, which can start and stop applications (gameserver in this case). I also have implemented a FTP Service in this socket too (for data transfer).
My Goal:
I want to connect my Web Dav to the FTP-Server of my socket, which means File Listening, Download, Upload. The usecase should be, that a user only connect to a single service. Imagine, my socket is running on more then one server.
If i would implement this with my current know how, i would do it this way:
User Request Web Dav Directory
Server make a file listening of the FTP Server
The file listening is added dynamicly to the Web Dav Directory
Now the user open the directory, and want to download the file:
Web Dav Server request the file from the Ftp server
Web Dav Server provide the downloaded file
Web Dav Server delete the provided file
On the other direction, the WebDav Server will accept a file, and upload it then to the FTP Server.
If the servers are not in the same datacenter, this cost traffic. Anyway, i think it takes some time, if the data are binrary instead of textbased configs. Also, the client side progress bar will not notice, if the download to the webdav server / upload to the ftp server is processed (the user possible think nothing happens).
I hope i have successful communicated, where my problem is.
So how can I implement this, without delegate an upload/download from one server to another? Is this even possible?
Bonus: Would a solution like WebDav to Webdav or FTP to FTP provide a better way of implementing it?
Easy way to achieve this is to have a third party software like webdrive to map the ftp server contents to a drive letter. Then point the webdav server to this drive. Windows also provides option to map a webdav/ftp URL as a drive letter so that the application can access it as if its a local drive.

Remote execute Windows process in the context of another machine

Is it possible to execute a non interactive Windows process on remote machine B, but in the context of a different machine A (in my case the one giving the execute order).
What I try to achieve, is to use the CPU/power of a remote machine to run an executable, but it needs to use automatically the resources of my machine. That is, if the executable references a file (e.g. c:\dir\myfile.txt) or registry, it will automatically use "my" "c:\dir\myfile.txt" disk and registry and not the machine on which is actually executed.
Thanks
I think you ca achieve that with some type of Client /Server protocol. Host B listens to requests and saves the requests host Information. After that Host A gets a server state and listens to file/directory requests from host B. While the first connection is still alive it can be finished with the application result and a finished Handshake or something similar.

Transfer Files To VPS Using FTP

I Just Got A Free VPS From Upcloud.com
It has VNC Preinstalled, 2 GB Ram, 1 Core Cpu.
I Just Installed PHP and mySQL.
My Vps Ip
http://83.136.252.156/
How do I upload with ftp files to:
/var/www
?
Nooooo!
Don't use that protocol left over from the 70th! It is a nightmare for all firewall administrators.
Use the ssh server instead which you undoubtedly already used for other purposes:
the ssh server offers sub protocols, namely scp and sftp.
You can use sftp from the command line, many modern ftp clients also support this more advanced protocol too. And you don't have to install and configure an additional ftp server which can be painful. And you get strong encryption of your credentials as well.
There are many manuals out there in the internet.
Create yourself a key (much more safe and convenient than using passwords) and go!
upload your files through ftp client called 'Filezilla' or if you have upload facility through control panel itself then well upload from their itself. Create FTP from your control panel and Download filezilla and install it locally on your system and upload by connecting to your server using following details like Host, Username, Password and Port.
But i suggest not to go with free hosting services where they are used one and would have changes to spam access more. Anyhow if your looking for some best and cheap vps hosting services than will suggest for my datacenter provider, which is TRIJIT.

How to check programmatically the OS of remote host?

I need to check if remote host is Windows or Unix/Linux.
I can't assume that it has web server configured.
All I can do is to try to connect to several TCP or UDP services.
Which TCP services (TCP port numbers) usually will be opened on Windows and not on Unix/Linux and vise versa?
The other way is to try to ssh to it, and if it fails assume that it Windows host. The problem is, that I need this in order to choose the remote access method ssh or something Windows friendly like psexec.
You can read the output of nmap to detect which OS a remote host is running. It has a whole module dedicated to this. Here is a guide to using it.
Why not just try to connect one way, and if that fails, connect the other way, and if neither work, tell the user?
If that's all you're trying to do, there's no need to actually check the OS.
This is not an easy thing to answer with any degree of certainty as there are very few ports that will always be open on one OS but not on another.
You could try some/all of the following
80 http obviously
22,23 Telnet and SSH (Not usually open on windows, one at least usually open on *nix)
135 Used by WMI so often open on windows
1443 (Possibly SQL Server)
691 Used by MS Exchange routing
3389 MS Remote Desktop
I would suggest that scanning ranges of ports may lead you into trouble particularly if these are not your machines. You may find your IP address logged as a possible source of "Port Scanners"
There are some fairly extensive lists of ports available on the web. e.g. http://keir.net/portlist.html

Resources