Allow "unknown sources" from Terminal without going to Settings App? I have a corrupted Settings app in CyanogenMod and have a possible idea to restore a backup of it (App and Data) in Titanium Backup. But it's currently set to not allow "unknown sources" so Titanium cannot actually restore the old Settings over the current (corrupted) one.

I have a Terminal app installed on the phone. Is there a command in Terminal to essentially 'tick' that "unknown sources" setting, since I can't open the Settings app itself? (It gives this.)
As mentioned in the comments by OP, SQLite Editor is fit for the job. Following solutions tested on Stock Android 4.2.1 and 4.4.2.

Instructions for  root users:


Install and launch SQLite Editor from Play Store.
Under APPS, tap Settings Storage &rarr; settings.db &rarr; global.
Tap install_non_market_apps  &rarr; click pencil icon (at the top) to edit it and change the Value to 1.
The changes took effect immediately in my device. Otherwise, restart and Unknown Sources would be found enabled.

(Source)


Instructions for non-root users:


Install ADB in your PC, connect your device, and enter:

adb shell settings put global install_non_market_apps 1


Unknown Sources would now be enabled. (Source)
Change the last command's value to 0 to disable the Unknown Sources.