How does editing a remote file work? - ssh

I was wondering how editing a remote file without downloading it to the local computer actually works in detail. After using google and reading some posts I learned that this is possible using the FTP or SSH protocol.
I assume that it's up to a special client application to set up a TCP/IP socket connection to a server, but what is going on after this is done?
Who needs to implement the protocol and how does another application that opens a remote file gain the data that it needs?

SFTP protocol (do not mix it with FTP/FTPS), which works over the SSH, allows per-block access to the remote file. And it will work with almost any SSH server (where sftp subsystem is allowed).
For instance, in this way works SFTP Net Drive application, which mounts remote server's filesystem as Windows drive.

The application would download the whole file locally, open it, make changes and upload the whole file again. A classic example is WinSCP where you can 'edit' a remote file. The application (WinSCP) knows which protocol to use (FTP/FTPS/SFTP etc) and knows the parameters to be used (e.g. remote directory to upload the file to, username, password, port etc). Even if a file is large the whole file must be downloaded in order to me modified.
There appears to be no way of doing partial file updates in FTP, SFTP. HTTP or SCP. Infact there is no well known open source protocol to do this. If there is an implementation out there it has to proprietary.

The Wikipedia articles on FTP and SFTP seem reasonably good and provide links to the RFCs if you want to investigate further.
Who needs to implement the protocol and how does another application that opens a remote file gain the data that it needs?
You don't say which language your program will be written in, but there are surely suitable ftp and sftp libraries available for most of them.
If your program is running on Linux / OS X / other BSD you could even get away with calling the ftp/sftp programs.

Related

Delphi 10.4 Setup SFTP Client with PPK

I am searching for a possibility to load up a simple text file to an SFTP directory. I was shocked as I noticed a nearly 5k worth development environment is not able to connect to an SFTP Server (20-Year-old standard specification), without taking another 500 bugs to buy a Component from a third-party developer Studio. Am I right? Or is there a way to get an SFTP connection with Delphi Board Components?
I was not able to find a solution with Delphi components.
I used "SFTP Client and Server Library" from /n Software.
Works like expected, Support is good.

Transfer files from an unix server to a windows server using mule

I need to transfer some files from an Unix server to a windows server using Mulesoft; that is Source: Unix server and target: windows server.
Also I have to archive the files in source Unix directory, once they are processed.
How can I achive this? Can I use two SFTP connectors? Any direction towards how can I achive this would be really appreciated. Thank you.
This is not Mule question. Mule is note Magic which solves all your problems.
This question is about how to transfer files from Unix to Windows. It is not clear where your Mule runtime working. It could be on Unix since you had mention that Windows target has no FTP or it could be Windows since you tag question with Anypoint-studio.
Assuming your runtime is on Unix. Then question is simple how to transfer file from Unix pushing to Windows. Since your Windows box has no FTP and excluding weird solution like sending email I know only one solution Samba but it requires some knowledge of Unix.
If your runtime is Windows then it's opposite question - how to get files from Unix. Probably Unix already have FTP server or the same Samba can help.
In both cases eventually you will see opposite side as regular file and then you can use File Connector which will do the job including archiving (use move file box to store processed file).
If you have Mule runtime running on both environments which communicate with each other (which I doubt) then one of them (slave, with source so, Unix) could produce HTTP connector to expose files and then another one on Windows, as active (master) one should use HTTP connector to get these files.

How to implement secure FTP connection on iOS

Apple provide a CFNetwork guide, where described how to work with FTP. I interested to work with SFTP. Everywhere chilkat ftp library is suggested, but he has a too big feature list, that is unnecessary to pay.
Are there any way to connect to SFTP only for download, upload and viewing directory lists?
/n software IP*Works! SSH for iOS (www.nsoftware.com/ipworks/ssh/) is another commercial solution. It includes an SFTP library as well as a number of other iOS communications libraries.
SFTP is just an extension of the SSH protocol. I would look for an open source SSH library, such as this one. Most have support for the SFTP protocol.
One thing to note, if you intend to use it in an App Store app, you may want to remove the server capability from the library, as Apple probably wouldn't allow it. If, by some slight chance, the library even builds and runs with the SSH server capability, you may be able to get it into the App Store if you don't enable the server.
Of course, I'm sure there are libraries out there with client-only capabilities if removing server support yourself doesn't sound all that dandy.

What protocol does RDP on Windows 7 use for copying files via the clipboard?

When I copy a local file and paste it to a remote computer through an RDP session (both clients are Windows 7) is it transferring the file data via SMB, SFTP, or some other protocol/port? I've poked around the RDP GUI and don't see any clear reference to clipboard transfer protocols or ports. Just curious.
RDP is its own protocol, and clipboard sharing is provided by it.
From the Remote Desktop Protocol spec:
Clipboard mapping
Users can delete, copy, and paste text and graphics between applications running on the local computer and those running in a remote desktop session, and between sessions.
You can also get a full paper on the RDP protocol from MSDN here. The PDF describes the protocol in terms of the bare-bones protocol, the archive of PDFs supplies papers for the individual services that sit on top of it.

Display remote files through a WCF service

I don't want to reinvent the wheel, I must display remote files and folders (like SQL Management studio does), should I develop my own interface and logic or there is an alternative? I need multiple selection.
I'm using VS2008 .Net Framework 3.5 SP1
Thanks
EDIT:
I built a multi-ambient music server that is running in the network and i must provide the ability to select which music files or folders should be played. The files resides on the server and are not available to the clients. The clients comunicates to the server trought a WCF service i built.
When you say remote, exactly what do you mean? Do you mean on another server in your intranet, or out on the wide web?
If you just need to view files on another machine in your intranet, the built in file chooser in .net will work. All you need to do is hand it a network address (like: \somemachine\somefilepath).
If you mean more remote than that, then FTP might be an option. You can build yourself basic FTP functionality in your C# application in very little time. Google "C# FTP" and you'll find lots of examples.
A third option would be a simple WCF service that returns a list of file names. But you said you needed "multiple select", so I am assuming you want to do more than just "read" the files, in which case you need to transfer them over the wire, in which case I recommend the FTP route.
Addition to the above - what do you mean by "files", and how would you expect to display them? In a custom application, or by using Windows Explorer?
WCF may not be the most appropriate way to do this, as was said above. There are already file transfer protocols in the world, and if you don't want to reinvent the wheel, then you shouldn't create a file transfer protocol based on WCF. You should use FTP, HTTP or WebDAV.
Otherwise, you should look at those protocols (especially WebDAV) for inspiration on what your service will need to do. It will need to expose a concept of files and folders, and to have a way to get file information and get files.
Just like "the wheel" already does.