Differences
This shows you the differences between the selected revisions of the page.
2019-08-26 | 2019-09-25 | ||
updating log header sample + typo (martin) | 5.16 Individual configuration storage sections can be set read-only (martin) | ||
Line 32: | Line 32: | ||
You may also use an INI file in a different folder or with a different name using ''[[commandline#configuration|/ini]]'' switch or in [[ui_pref_storage|preferences]]. | You may also use an INI file in a different folder or with a different name using ''[[commandline#configuration|/ini]]'' switch or in [[ui_pref_storage|preferences]]. | ||
+ | |||
+ | ===== [[readonly]] Read-Only Configuration ===== | ||
+ | |||
+ | Particularly, when using a shared INI file or when pre-configuring WinSCP for a specific task, you may want to set the configuration or its parts read-only. | ||
+ | |||
+ | ==== [[readonly_sections]] Read-Only Configuration Sections ==== | ||
+ | |||
+ | //In the latest beta version,// &beta you can set individual configuration sections read-only. This way you can for example prevent a user from changing default transfer settings, while still allowing other kinds of customizations. | ||
+ | |||
+ | Setting a configuration section read-only makes WinSCP silently discard any changes to that section, when saving the configuration. | ||
+ | |||
+ | An access to individual sections is controlled using an optional ''Access'' key. If the key is not set, a section inherits the state of its parent section. By default, all sections are writable. To set a section read-only, set its ''Access'' key to ''readonly''. To enable writing to a subsection of a read-only section, set the subsection ''Access'' key to ''full''. | ||
+ | |||
+ | To change the default state of whole configuration, set root ''Access'' key. In Windows registry, it is a key in [[config#registry_key|WinSCP root registry key]]. As INI files have no root section, WinSCP looks into a special section named ''[_]'' (a single underscore). | ||
+ | |||
+ | For example the following INI file sets all configuration read-only, with an exception of a host key cache and interface settings (but in turn with an exception of transfer settings, which are again read-only): | ||
+ | |||
+ | <code ini> | ||
+ | [_] | ||
+ | Access=read | ||
+ | |||
+ | [SshHostKeys] | ||
+ | Access=full | ||
+ | ... | ||
+ | |||
+ | [Configuration\Interface] | ||
+ | Access=full | ||
+ | ... | ||
+ | |||
+ | [Configuration\Interface\CopyParam] | ||
+ | Access=read | ||
+ | ... | ||
+ | </code> | ||
==== [[ini_readonly]] Read-Only INI File ==== | ==== [[ini_readonly]] Read-Only INI File ==== | ||
- | Particularly when using shared INI file, you can set read-only attribute to the INI file to prevent WinSCP from overwriting the file. | + | A simpler way to make whole configuration read-only is to use an INI file and set it read-only in a file system. This option is available even in the older versions. &beta |
When INI file directory or the file itself is not writable (for example when the INI file is in ''Program Files'' folder or when it is explicitly set read-only), WinSCP does not preserve its state when exiting. No error message is displayed. Only when you explicitly change configuration (such as when you save [[session_configuration|site]], or submit [[ui_preferences|Preferences dialog]]), an error is shown. You can make WinSCP overwrite a read-only INI file by holding ''Shift'' key, while closing or submitting Preferences dialog. | When INI file directory or the file itself is not writable (for example when the INI file is in ''Program Files'' folder or when it is explicitly set read-only), WinSCP does not preserve its state when exiting. No error message is displayed. Only when you explicitly change configuration (such as when you save [[session_configuration|site]], or submit [[ui_preferences|Preferences dialog]]), an error is shown. You can make WinSCP overwrite a read-only INI file by holding ''Shift'' key, while closing or submitting Preferences dialog. | ||
Line 59: | Line 92: | ||
===== Pre-configuring WinSCP ===== | ===== Pre-configuring WinSCP ===== | ||
Learn how to [[custom_distribution|distribute pre-configured version of WinSCP]]. | Learn how to [[custom_distribution|distribute pre-configured version of WinSCP]]. | ||
- | |||