Work In Progress: This software may kill your kitten!
Replace your login-shell with wemux-login for your wemux-only ssh user.
- Get this repository:
$ git clone https://github.com/tryone144/wemux-login
$ cd wemux-login- Build with
cargo:
$ cargo build --release- Install into
/usr/local/bin:
$ sudo install ./target/release/wemux-login /usr/local/bin/wemux-login- Create a new user and group:
$ sudo groupadd -g 22423 wemux
$ sudo useradd -u 22423 -g 22423 -s /sbin/nologin -d /usr/local/share/wemux -c 'WEMUX Remote User' -m -N -G wemux wemux
$ sudo passwd wemux- Add
wemux-loginto/etc/shellsas a valid login-shell:
$ echo "/usr/local/bin/wemux-login" | sudo tee -a /etc/shells- Add
wemux-loginas the default login-shell for this user:
$ sudo usermod -s /usr/local/bin/wemux-login wemux- Start a
tmux/wemuxsession on the host:
$ wemux start- Connect to this remote session using ssh:
$ ssh -t wemux@remotehost pair- Show a help message:
$ ssh wemux@remotehost help- List Remote sessions / servers:
$ ssh wemux@remotehost list- Connect to specific session / server
SESSION:
$ ssh wemux@remotehost <mode> SESSIONSupported modes include:
| Mode | Description |
|---|---|
mirror |
No interaction, i.e. read-only viewer. See wiki |
pair |
Default tmux interactions. See wiki |
rogue |
Not Supported! Independent session, i.e. free interaction. See wiki |
See the wiki for a guide on how to use different sessions.
- Disable or enable the
wemuxuser:
# Disable user `wemux`
$ sudo usermod -L wemux
# Enable user `wemux` again
$ sudo usermod -U wemux- Alternative method using
expiredate(see this post):
# Disable user `wemux`
$ sudo usermod --expiredate 1 wemux
# Enable user `wemux` again
$ sudo usermod --expiredate "" wemux(c) 2018 Bernd Busse, The MIT License