Отключение внешнего монитора приводит к перезагрузке

If I set some permission bits on a directory in the file system, for example to be executable and readable and writable only by root, will the permission bits be respected when I plug the external hard drive to a Windows system?

No, los permisos de archivos UNIX no funcionan en Windows.

I would like to find a way to restrict access to a directory on my external hard drive from any OS.

En general, cada sistema operativo tiene su forma diferente de establecer permisos, por lo que eso no es posible. Deberá establecer los permisos apropiados en los archivos según el sistema operativo que esté montado actualmente en el sistema de archivos.

Citando de esta respuesta:

NTFS has Windows ACEs. Unix uses "mode bits" on each file.

On NTFS, each file can have an owner, and zero or more Windows access control entries (ACEs). An ACE consists of a principal (users and groups are principals), a set of operations (Read, Write, Execute, etc.) and whether those operations are allowed or denied. Files can have many ACEs. Other objects in Windows other than files can have ACEs as well, such as registry entries, printer objects, and other things. All ACEs are taken into account when a file operation occurs. Deny takes precedence over allow. Windows ACEs support inheritance where you can set an ACE for a directory and have it automatically propagate to lower level directories.

Files in Unix have an owning user (owner) and an owning group (owner-group). There are three fixed "principals" which are owner, members of the owning group, and everyone else (a.k.a world). For each principal there are three "bits" which cover read, write, and execute abilities. (these have different meanings for directories than files, see this). These bits determine who can perform what operations. This is called the file's mode and is built into the file (there are no separate ACEs).

2
30.06.2019, 16:24
2 ответа

rможет быть частью формата:

printf 'r %s\n' {1..100}
-121 ---201261 ​​-

Этот ответ предполагает, что событие подключения/отключения монитора не запускается. Если это действительно так, то, на мой взгляд, это основное узкое место графического интерфейса Linux/X11.

В этом ответе в качестве обходного пути предлагается опрос(xrandr --listmonitorsпоказывает подключенные/отключенные мониторы, решением может быть периодическое выполнение скрипта ).

Однако опрос работает плохо. Лучшим вариантом будет привязать скрипт исправления монитора к сочетанию клавиш. Напишите скрипт, который

  1. получает список подключенных/отключенных мониторов
  2. выключает всегда то, что нужно (в зависимости от того, что подключено)
  3. привязать его выполнение к сочетанию клавиш .
1
27.01.2020, 22:16

В качестве краткосрочного исправления, чтобы избежать перезагрузки, разблокируйте экран, нажмите сочетание клавиш, чтобы открыть терминал, и запустите xrandr --output eDP1 --auto, чтобы снова включить монитор. Вы можете делать все это «вслепую», когда ваш монитор отключен.

0
30.06.2021, 16:48

Теги

Похожие вопросы