SFTP on RISC OS
Alan Adams (2486) 1149 posts |
Is there a way to connect to an SFTP server from RISC OS? I’ve been trying to connect to a remote server using the software interface to FTPc, which works on an FTPS server, but not SFTP, which I didn’t know until today is something completely different. |
Stuart Swales (8827) 1357 posts |
You could try the PSFTP client from http://www.riscos.info/packages/NetworkDetails.html#PuttyToolsarm Its pscp tool works OK for me, but I don’t have a SFTP server set up to try psftp. [Oh yes, that works fine too.] PuttyTools is also available from PackMan |
Alan Adams (2486) 1149 posts |
Thanks. I’ve been trying that, and making some progress, until the server stopped responding. It isn’t responding to browsing either, so I suspect I may have crashed it. It’s a hosted service for a club I’m involved with, so I don’t have control over the server itself. It does seem a bit flakey though. [Edit] The server became reachable again after I rebooted my router. Coincidence? |
Mr Rooster (1610) 20 posts |
[Edit] The server became reachable again after I rebooted my router. Coincidence? If that gave you a new IP address then probably not. It’s common to have repeated connections to the SSH port result in a firewall level ban as this helps block a lot of the brute force SSH attacks. (SFTP being a file transfer protocol implemented over SSH). |
Alan Adams (2486) 1149 posts |
That’s a scenario I hadn’t thought of. However trying to access the website on the same server over HTTP returned “name not found”, and I’ve had issues in the past where the router seems not to work for name resolution, hence the reboot. |
Raik (463) 2061 posts |
I use psftp with Sitematch to deal with riscos.berlin (FTPc is not working). |
Alan Adams (2486) 1149 posts |
So I’m picking up here, because I want to automate updating part of a site that only accepts sftp. (I can do this with other sites that use ftps, by calling ftpc functions.) Is there a way to operate psftp from a BASIC program? All I can see from the manual is a way to use the command line (from OSCLI) to execute a batch script. I might be able to get this to work, by creating the batch script each time, but it looks clumsy, and I’m not clear what to do with the output it would generate. I don’t want task windows popping up. In addition, I may well need to check the datestamp of a file on the server before deciding to replace it. I might be able to avoid this if there’s an option to only upload if the file is newer. Is that possible? |
Raik (463) 2061 posts |
As I understand your post, that is exactly (?) what SiteMatch does. |
Alan Adams (2486) 1149 posts |
I don’t think I can use Sitematch in this case, unless it can continuously update in the background. The content of the website will be changed every few minutes. It’s displaying the scores in a competition as the competition progresses. As Sitematch is written in BASIC, I might have to download it to find out how it’s done there, and then replicate it. I have code that can do this with files served by Webjames on a local network, but providing wireless access to it has proved unreliable – not Webjames at fault, but the combination of various phone OSs, their expectation that the network they connect to will have internet connectivity (it doesn’t), and the tendency of the wireless access point to drop connections. So my thought is to put the files on the club’s main website, and update by selectively replacing files as the local copies get updated. That site only supports sftp, not ftps, so I can’t use FTPc, which conveniently has an API. The replacement needs to be very selective for two reasons – to avoid overloading the server with file uploads, and to avoid disrupting the experience of people viewing the site as files get replaced. Ideally the replacement would be done by overwriting the previous version of the files, as that minimises the time when an invalid or incomplete file is offered. If I have to first delete then upload each file, its going to be more disrupted. |
Jean-Michel BRUCK (3009) 359 posts |
!SiteMatch works fine. |
Alan Adams (2486) 1149 posts |
I’m struggling. I’ve downloaded Sitematch and run it. I set up the configuration for a test site. [Edit] forget that. I now see there’s a psftp button as well as an sftp one. (I read the first as ftps when I first configured it.) However I’m now getting “Connection refused” instantly. Using the same values for everything in a psftp batch script, and running it directly from psftp works. So that will be my solution. |