Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readme.md improvements #69

Merged
merged 3 commits into from
Jul 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Keyszer requires read/write access to:
- `/dev/uinput` - to provide an emulated keyboard to the kernel


### Running as a semi-privleged user
### Running as a semi-privileged user

It's best to create an entirely isolated user to run the keymapper. Group or ACL based permissions can be used to provide this user access to the necessary devices. You'll need only a few `udev` rules to ensure that the input devices are all given correct permissions.

Expand All @@ -153,12 +153,21 @@ First, lets make a new user:

sudo useradd keymapper


...then use udev and ACL to grant our new user access:

*/etc/udev/rules.d/90-keymapper-acl.rules*
Manually edit `/etc/udev/rules.d/90-keymapper-acl.rules` to include the following:

KERNEL=="event*", SUBSYSTEM=="input", RUN+="/usr/bin/setfacl -m user:keymapper:rw /dev/input/%k"
KERNEL=="uinput", SUBSYSTEM=="misc", RUN+="/usr/bin/setfacl -m user:keymapper:rw /dev/uinput"


...or do it by copypasting these lines into a shell:

cat <<EOF | sudo tee /etc/udev/rules.d/90-keymapper-acl.rules
KERNEL=="event*", SUBSYSTEM=="input", RUN+="/usr/bin/setfacl -m user:keymapper:rw /dev/input/%k"
KERNEL=="uinput", SUBSYSTEM=="misc", RUN+="/usr/bin/setfacl -m user:keymapper:rw /dev/uinput"
EOF


#### Group based permissions (slightly wider, less secure)
Expand All @@ -170,10 +179,18 @@ Many distros already have an input group; if not, you can create one. Next, add

...then use udev to grant our new user access (via the `input` group):

*/etc/udev/rules.d/90-keymapper-input.rules*
Manually edit `/etc/udev/rules.d/90-keymapper-input.rules` to include the following:

SUBSYSTEM=="input", GROUP="input"
KERNEL=="uinput", SUBSYSTEM=="misc", GROUP="input"


...or do it by copypasting these lines into a shell:

cat <<EOF | sudo tee /etc/udev/rules.d/90-keymapper-input.rules
SUBSYSTEM=="input", GROUP="input"
KERNEL=="uinput", SUBSYSTEM=="misc", GROUP="input"
EOF


#### systemd
Expand Down