Releases: cloudposse-archives/sudosh
Releases · cloudposse-archives/sudosh
0.3.0: convert to github actions (#17)
0.2.0
0.1.4: Migrate to README.yaml template (#12)
Migrate to README.yaml template
Avoid Recursive Shells
what
- Export
SHELL
to match the desired shell, rather than the currentsudosh
shell - Do not use
-s
as it causes an unnecessary subshell - Emulate more closely the behavior of the desired shell (which is why we dropped the
--
)
why
- When
SHELL
was set to the currentsudosh
wrapper shell, it would cause infinite loops for non-login shells (E.g. where a command was passed viassh
) - Better compatibility with system login shells
Try multiple methods to determine current user
what
- Check
USER
,USERNAME
, andwhoami
if we cannot calluser.Current()
why
- Alpine linux does not implement underlying sys call for
user.Current()
Inherit Parent Environment
what
- inherit parent environment
- use default shell to execute shell commands
why
- parent env is rather important because without it, ssh agent forwarding is impossible (e.g.
SSH_AGENT_SOCK
)
Implement a Shell Wrapper for `sudo`
what
- implement a
sudo
wrapper that will sudo self
why
sudo
provides built in session logging and ability to restrict commands that are run- when used as a login shell (e.g.
chsh -s /usr/bin/sudosh foobar
) you can force session logging for any user upon login