K
K
Konstantin Korotaev2021-04-11 17:12:29
FreeBSD
Konstantin Korotaev, 2021-04-11 17:12:29

How to securely edit rc.conf remotely on FreeBSD?

Several times I came across a situation where, if editing rc.conf was unsuccessful, the system does not boot when you are near the machine, then there are no problems fixing the error, especially since the system will even tell you exactly where you made it, but there are situations when you configure something remotely, and without extreme necessity I try not to get into such configs without having physical access to the server, but still the need sometimes arises. In the case of editing, for example, IPFW rules, there is a script for safely editing rules, but the rules are applied without rebooting the system, and here this script helps out a lot.

Can you please tell me if there is something similar in case rc.conf was unsuccessfully edited? Or somehow ask the system to check the file before rebooting? Or with editing files, the action of which is applied after the system is restarted, is it like sappers?)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Konstantin Korotaev, 2021-04-11
@kacToHbI4

As for checking the file itself, I found the following command sh -n /etc/rc.conf . Maybe someone will come in handy, but the main question still remains relevant.

D
Denis, 2021-04-12
@denilenko

There is also a sysrc utility. Isn't it for safe editing rc.conf?

A
Alexander Chernykh, 2021-04-12
@sashkets

rc.conf is a default, it is not recommended to touch it,
create /etc/rc.conf.local and enter your parameters there with the correct syntax
at the start of the OS reads from rc.conf.local, if not needed, then looks in rc.conf

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question