/tool fetch usung SFTP with ssh-pk

Hi @all,

Over the last 13 years, I have developed a web application for user support that can analyze the status of our routers, DOCSIS headends, modems and CPE.

Recently, I decided that the Docsis boot file, which is available on our gateways, should be decoded and made visible in this application.

To do this, I have a servlet running in a container that accepts sftp uploads as an additional servlet in a tomcat servlet container.

The way I do it:
login via api (separate user) -> execute /tool fetch as upload with private key -> file is then on the web server, is displayed and immediately deleted (only for debugging, at least for now).

The login via admin-api-user requires that the private ssh key also belongs to this user. Under these conditions, this also works perfectly.

The following experiment:

I am logged in as api-user. Of course, this takes place via the API during operation - not here in the test.

I have generated and imported an ssh-pk:
[admin-api@testrouter] /user/ssh-keys/private> pr

USER KEY-TYPE BITS KEY-OWNER
0 ispManSFTP rsa 2048 ispManSFTP

Then I want to upload something via SFTP:
"/too fetch url="sftp://192.168.99.102/test.txt" upload=y src-path=test.txt port=444 user=ispManSFTP"

I wonder if it is a bug that the SSH-PK is ignored and only used if it is created on the user admin-api (which triggers the fetch-upload-command) and the user specification is basically ignored?

I know that there is a workaround via scripting to run a command with another user but that´s not a very elegant way as there have to be many manipulations to the scripts, which is possible but not very generative.

Any thoughts?

Greetings,

–Marc