8000 GitHub - cloudposse-archives/sudosh at 0.1.0
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

cloudposse-archives/sudosh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sudo Shell

Sudo Shell is a wrapper to run a login shell with sudo for the purpose of session audit logging.

Build Status GitHub Stars GitHub Issues Average time to resolve an issue Percentage of issues still open Contributions Welcome License

Purpose

The sudo command provides built-in session logging. Combined with sudoreplay it provides an easy way to review session logs on a bastion host. When used as a system login shell, it will force session logging.

Another common pattern is to use the OpenSSH ForceCommand directive in sshd_config combined with the script command to log sessions. This is ineffective because the user can easily bypass it. Using sudosh provides a more secure alternative that cannot be bypassed since it does not depend on ForceCommand.

Usage

Here's how to use it in 3 easy steps. Checkout the precompiled releases if you don't want to build it yourself..

  1. Enable sudo logging. Edit /etc/sudoers.d/audit-logs:

    Defaults log_output
    Defaults!/usr/bin/sudoreplay !log_output
    Defaults!/sbin/reboot !log_output
    
  2. Add this command to /etc/shells:

    /usr/bin/sudosh
    

    Tip: to prevent users from using other shells to login, remove those shells from /etc/shells.

  3. Update the user foobar to use the sudosh shell.

    chsh -s /usr/bin/sudosh foobar
    

Other Tricks

If you want to change the default shell from bash to something else (e.g. zsh), you can symlink sudosh to a different name.

To change the default shell to zsh, you could do:

ln -s /usr/bin/sudosh /usr/bin/sudosh.zsh

Then set the user's shell to /usr/bin/sudosh.zsh and add the shell to /etc/shells.

About

The sudosh utility is maintained and funded by Cloud Posse, LLC. Like it? Please let us know at hello@cloudposse.com

We love Open Source Software!

See our other projects or hire us to help build your next cloud-platform.

Contributors

Erik Osterman

Erik Osterman

About

Shell wrapper to run a login shell with `sudo` as the current user for the purpose of audit logging

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  
0