Wednesday, October 31, 2018

Re: syntax error and doas.conf

Stuart Henderson <stu@spacehopper.org> wrote:
> On 2018-10-31, Markus Rosjat <rosjat@ghweb.de> wrote:
> > just something I notice while trying out stuff with doas and my python
> > scripts. If you do a mistake and have a syntax error in the doas.conf
> > file you can easily look you self out from root privilages  :(
>
> If you aren't sure about a change you're about to make, keep a spare
> root shell open (or at least keep the editor open - save the file
> but don't exit - and test on another terminal).

When editing files, most of the time I go back to the shell using ^Z (editor go
in background), I do what's related to the file (try doas, restart httpd until
it works, etc..). And I use fg when I need to come back to the editor.

When playing with doas or sshd, I would recommend for doas to keep a root shell
opened in case you screw the file. And for sshd, when restarting it on a remote
machine, try to connect to it before exiting your current ssh session.

No comments:

Post a Comment