| Crates.io | ego |
| lib.rs | ego |
| version | 1.2.0 |
| created_at | 2018-12-15 14:56:26.588438+00 |
| updated_at | 2026-01-08 01:02:38.947609+00 |
| description | Alter Ego: run Linux desktop applications under a different local user |
| homepage | https://github.com/intgr/ego |
| repository | https://github.com/intgr/ego |
| max_upload_size | |
| id | 102036 |
| size | 65,854 |
Do all your games need access to your documents, browser history, SSH private keys?
... No? Just run
ego steam!
Ego is a tool to run Linux desktop applications under a different local user. Currently
integrates with Wayland, Xorg, PulseAudio and xdg-desktop-portal. You may think of it as xhost
for Wayland and PulseAudio. This is done using filesystem ACLs and X11 host access control.
Disclaimer: DO NOT RUN UNTRUSTED PROGRAMS VIA EGO. However, using ego is more secure than running applications directly under your primary user.
Distribution packages are available for:
After installing the package, add yourself to the ego-users group. After logout and login,
the ego command should just work.
(varia/README.md documents recommendations for distro packagers)
Ego aims to come with sane defaults and be easy to set up.
cargo and libacl (see below for optional dependencies), then:cargo install ego
sudo cp ~/.cargo/bin/ego /usr/local/bin/
# Use existing user
ego --user=<username> xdg-open .
# Or create local user named "ego": [1]
sudo useradd ego --uid 155 --create-home
ego xdg-open .
[1] ego is the default target username.
No extra groups are needed by the ego user.
UID below 1000 hides this user on the login screen.
libacl.so library (Debian/Ubuntu: libacl1-dev; Fedora: libacl-devel; Arch: acl)libxcb.so library (Debian/Ubuntu: libxcb1; Fedora: libxcb; Arch: libxcb)
Only used when X11 DISPLAY is set, can be disabled with --old-xhost.
machinectl command (Debian/Ubuntu/Fedora: systemd-container; Arch: systemd)
xdg-desktop-portal-gtk (Debian/Ubuntu/Fedora/Arch: xdg-desktop-portal-gtk)
If using "machinectl" mode (default if available), you need systemd version >=247 and polkit >=0.106 to do this securely.
Create file /etc/polkit-1/rules.d/50-ego-machinectl.rules, polkit will automatically load it
(replace <myname> with your own username):
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.machine1.host-shell" &&
action.lookup("user") == "ego" &&
subject.user == "<myname>") {
return polkit.Result.YES;
}
});
For sudo, add the following to /etc/sudoers (replace <myname> with your own username):
<myname> ALL=(ego) NOPASSWD:ALL
Fix: Handle missing PulseAudio socket when directory exists (#190)
Contributed by @mio-19, thanks!
Use X11 protocol directly via libxcb. The xhost dependency is no longer needed. (#163)
Use --old-xhost to revert to the old behavior.
X11 library libxcb is now demand-loaded and not required when X11 DISPLAY is unset. (#192)
snapbox instead of hand-coded snapshot testing (#102)(Version 1.1.4 was yanked, it was accidentally released with a regression)
machinectl if available, fall back to sudo otherwise (#47)--machinectl on Ubuntu, Debian with dash shell (#42)--machinectl-bare switch.--machinectl) (#8)--verbose flag (#4)--user argument and command-line parsing (#3)Initial version
Ego is licensed under the MIT License (see the LICENSE file). Ego was created by Marti Raudsepp.
Ego's primary website is at https://github.com/intgr/ego
Thanks to Alexander Payne (myrrlyn) for relinquishing the unused "ego" crate name.