How to lock/unlock recovery? If I lose the phone, someone may find it and try to reset the security pattern via recovery. How can I lock / unlock recovery via terminal?
You cannot lock the recovery. That's not recovery is intended.

The only chance to do so is locking bootloader.

However, if the bootloader on your device is not locked when it's out-of-the-box, then it can't be locked. Factory Reset Protection won't have much effect in this case.