In GUI cannot save authorized_keys with restricted commands.

Issue #166 resolved
J K created an issue

FreshTomato Firmware 2021.7 K26ARM USB AIO-64K

Netgear R6300v2

Used / Total NVRAM 41.23/ 64 KB

on the Admin Access page in the GUI, in the box where you paste authorized_keys I am trying to paste a key limited to a single command like

command="/opt/libexec/sftp-server -R",no-pty ssh-rsa AAAAB3NzaC1yc2EAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx router-bkup

but the GUI throws an error "Invalid SSH key(s). Also check for empty lines" because the JS is only expecting key types as the first element, not the syntax starting with command . I am able to update the keys through the shell but whenever I come back to that page and try to make another change- even to another element on the page- it wont save - just throws that error again.

Comments (2)

  1. pedro repo owner

    GUI: Administration: Admin Access: change regexp for 'Authorized Keys' to allow also pasting keys that start, for example, with some command (resolves #166)

    → <<cset b91e1c57a984>>

  2. Log in to comment