Skip to content

Instantly share code, notes, and snippets.

@timruffles
Last active April 17, 2020 03:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timruffles/5037956 to your computer and use it in GitHub Desktop.
Save timruffles/5037956 to your computer and use it in GitHub Desktop.
fix for tmux not starting up due to permissions issues

If you try to run tmux and get:

$ tmux
create session failed: : No such file or directory
$ strace -f -e trace=file tmux
...
[pid 15852] open("/dev/ptyp0", O_RDWR)  = -1 EACCES (Permission denied)

You don't have perms for the pseudoterminals. Add your user to the tty group

usermod -G tty sidekick

On root, check the pty[0-9][a-f] files are root:tty. If not chmod them

chown root:tty /dev/pty[0-9a-f]

Once you've got the permissions and groups sorted, log back in with the user. Tmux fun ensues.

@jdloft
Copy link

jdloft commented Feb 11, 2016

usermod -G tty sidekick should be usermod -a -G tty sidekick since you don't want to set tty to be the primary group. That will remove the user from all other groups.

@prologic
Copy link

Don't forget the permissions on /dev/pts/ptmux those need fixing too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment