Pls use winscp to edit files on the router.
“Permission denied” is generaly an issue due to wrong command format.