Forge Home

sftp_jail

Leverage saz-ssh module to build SFTP jails

10,148 downloads

8,872 latest version

4.3 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.1.3 (latest)
  • 0.1.2 (deleted)
  • 0.1.0
released May 31st 2016
This version is compatible with:
  • Puppet Enterprise 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >=3.5.0 <5.0.0
  • , , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'wusa-sftp_jail', '0.1.3'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add wusa-sftp_jail
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install wusa-sftp_jail --version 0.1.3

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

wusa/sftp_jail — version 0.1.3 May 31st 2016

sftp_jail

Build Status

Table of Contents

  1. Overview
  2. Usage - Configuration options and additional functionality
  3. Parameters

This module leverages saz-ssh to more easily create a more robust-ier SFTP jail. Because of how SSH key pairs work in Linux, this module creates a home dir for each jail user, so that keys can be added to authorized_keys and a homedir assigned without the nasty problem of the user escaping from the jail and landing in / because of a mistaken homedir assignment.

Usage

Examples

Single user

The sftp_jail::jail resource creates a jail with a single home directory and an incoming directory. incoming is owned by the user and group provided when declaring the resource:

    sftp_jail::jail { 'myjail':
      user  => 'bbriggs',
      group => 'bbriggs',
    }

Shared jail

Sometimes, more than one user will need to access the same jail, but with different permissions. For instance, one may need read-write access while another is limited to read-only. In such a case, first create the jail with your write user and set up a match_group that redirects users. Again, the users and groups must already exist.

    sftp_jail::jail { 'shared_jail':
      user        => 'writeuser',
      group       => 'writegroup',
      match_group => 'sftpusers',
    }

Now add a user to your jail.

    sftp_jail::user { 'readuser':
      jail => '/chroot/shared_jail',
    }

To share write access to /incoming, set the group parameter of sftp_jail::jail to a group that is common to both users, such as the sftpusers group that you might use to redirect users into a jail.

Parameters

Jail

user

The user that will own the corresponding home directory in the jail, giving the user a place to land. Also sets user ownership for /incoming.

group

The group that will own the corresponding home directory in the jail, giving the user a place to land. Also sets group ownership for /incoming.

match_group

Set the group that SSHd will look for when redirecting users to the jail. Useful for shared jails. Defaults to the value of group.

User

user

The username that will own the corresponding home directory in the jail, giving the user a place to land. Defaults to resource title.

group

The group that will own the corresponding home directory in the jail, giving the user a place to land. Defaults to resource title.

jail

The path of the jail's base directory, such as /chroot/myjail. Do not include a trailing slash.