sftp_jail
: Manage SFTP Jails
sftp_jail::jail
: One SFTP Jail where users get "chrooted" intosftp_jail::user
: Adds a user's home directory to an SFTP jail.
Sftp_jail::File_name
: The name of a file. Not a full path!Sftp_jail::Sub_dirs
: A list of subdirectoriesSftp_jail::User_name
: Each user or group should have a unique alphanumeric name.
Manage SFTP Jails
The following parameters are available in the sftp_jail
class:
Data type: Hash[String[1],Hash]
Jails to create. See sftp_jail::jail
for more details.
Default value: {}
Data type: Hash[String[1],Hash]
Users to create. See sftp_jail::user
for more details.
Default value: {}
Data type: Stdlib::Absolutepath
All jails are located in this directory.
Default value: '/chroot'
Data type: Sftp_jail::Sub_dirs
A list of default subdirectories to ensure in every SFTP users home. Having a
default list of subdirectories is especially usefull, when a lot of users
need to have the exact same directory structure in there home. This list
can be overwritten or extended for each user seperatly.
see: sftp_jail::merge_subdirs
Default value: []
Data type: Boolean
Merge each users list of subdirectories (sftp_jail::user::sub_dirs
)
with the default list of subdirectories (sftp_jail::sub_dirs
)?
Default value: false
Data type: Enum['yes', 'no']
Default Password Authentication setting for SFTP jails. This will only impact SFTP users which are put in a chroot jail by this module.
Default value: 'no'
A jail can have one or multiple users. With multiple users, they can share
some date via the /incomming
directory.
# 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',
}
# 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.
The following parameters are available in the sftp_jail::jail
defined type:
Data type: Sftp_jail::File_name
The jails name.
Default value: $name
Data type: Sftp_jail::User_name
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
.
Default value: $name
Data type: Sftp_jail::User_name
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
.
Default value: $user
Data type: Sftp_jail::Sub_dirs
This directory structure is enforced in the users Home.
Default value: $sftp_jail::sub_dirs
Data type: Boolean
Merge sub_dirs with the default sub_dirs?
Default value: $sftp_jail::merge_subdirs
Data type: Sftp_jail::User_name
Set the group that SSHd will look for when redirecting users to the jail.
Useful for shared jails. Defaults to the value of group
.
Default value: $group
Data type: Enum['yes', 'no']
Can the user login with a password? Public key authentication is generally recommended and has to be configured outside of the scope of this module.
Default value: $sftp_jail::password_authentication
Used for shared jails to allow multiple users to write, or to allow one user to write and others to read-only.
sftp_jail::user {'bob':
jail => '/chroot/myjail',
}
sftp_jail::user{'bob':
group => 'myjail_write',
jail => '/chroot/myjail',
}
The following parameters are available in the sftp_jail::user
defined type:
Data type: Stdlib::Absolutepath
The path of the jail's base directory, such as /chroot/myjail
. Do not
include a trailing slash.
Data type: Sftp_jail::User_name
The username that will own the corresponding home directory in the jail, giving the user a place to land.
Default value: $name
Data type: Sftp_jail::User_name
The group that will own the corresponding home directory in the jail.
Default value: $user
Data type: Sftp_jail::Sub_dirs
This directory structure is enforced in the users Home.
Default value: $sftp_jail::sub_dirs
Data type: Boolean
Merge sub_dirs with the default sub_dirs?
Default value: $sftp_jail::merge_subdirs
The name of a file. Not a full path!
Alias of Pattern[/\A[^\/\0]+\z/]
A list of subdirectories
As!8df/[1qwEr/zXcv0'
Alias of Array[Pattern[/\A([^\/\0]+\/*)*\z/]]
From useradd(8): It is usually recommended to only use usernames that begin with a lower case letter or an underscore, followed by lower case letters, digits, underscores, or dashes. They can end with a dollar sign. Usernames may only be up to 32 characters long.
Many installations also allow capitals or periods, for example to separate first and last names.
Alias of Pattern[/\A[a-zA-Z_]([a-zA-Z.0-9_-]{0,30}[a-zA-Z0-9_$-])?\z/]