Shareman Code
Brought to you by:
qu1x
##############################################################################
# This file is part of shareman. #
# #
# Copyright (C) 2011-2014 Rouven Spreckels <n3vu0r@nevux.org> #
# #
# Every year in a range, inclusive, is a copyrightable year as if it would #
# be listed individually. #
# #
# shareman is free software: you can redistribute it and/or modify #
# it under the terms of the GNU Affero General Public License version 3 as #
# published by the Free Software Foundation on 19 November 2007. #
# #
# shareman is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU Affero General Public License for more details. #
# #
# You should have received a copy of the GNU Affero General Public License #
# along with shareman. If not, see <http://www.gnu.org/licenses/>. #
##############################################################################
* Description
Shell script to manage chrooted sftp users and their shares.
* Website
<http://shareman.nevux.org/>
* Install
Install openssh-server.
Run the following commands from this folder to install shareman:
./configure --sysconfdir=/etc
make
sudo make install
* Setup sftp to chroot users of the on demand created group sftp
Enabling sharing via shareman with
sudo shareman on
for the first time will modify the following file:
/etc/ssh/sshd_config
A backup file will be created being a marker to prevent further modification tries:
/etc/ssh/sshd_config~shareman
The line
Subsystem sftp /usr/lib/openssh/sftp-server
will be replaced with the following one.
Subsystem sftp internal-sftp
Following lines will be placed at the very end of the file.
Match Group sftp
ChrootDirectory %h
X11Forwarding no
AllowTcpForwarding no
PasswordAuthentication yes
ForceCommand internal-sftp
Each of the last five lines will be indented by one tabulator.
* Use
Run the following command:
shareman --help
* Uninstall
Run the following command from this folder to uninstall shareman:
sudo make uninstall
On demand undo the setup of chrooting users of group sftp by restoring the backup file:
sudo mv /etc/ssh/sshd_config~shareman /etc/ssh/sshd_config
On demand remove the group sftp
sudo groupdel sftp
On demand uninstall openssh-server.