<commit_before>linux-chroot-jail
=================

Script to jail Linux users for ssh, sftp and vsftp
<commit_msg>initial doco.<commit_after>linux-chroot-jail
=================

Scripts to jail Linux users for ssh, sftp and vsftp

## jailuser.sh

~~~
jailuser.sh <username> 
~~~

This script creates a jailed ssh session for user <username> whenever they
they login to the server thereafter. The <username> is restricted to
the list of commands specified in **$APPS**.

It should work on most Linux distributions.
Tested on Ubuntu and Centos.

The users jailed home is under */jail/home/<username>*
A backup is made of <username>'s old /home directory to */home/<username>.orig*

All the libraries needed by the specified $APPS are copied to the chrooted
environment automatically.

### NOTE
- Changes are made to */etc/ssh/sshd_config* by the script to set the
ChrootDirectory.  The ssh server will need to be restarted manually for
the change to take effect.
- Here are the changes that are made.
```
Match group jailed
  ChrootDirectory /fhome/jail
  AllowTCPForwarding no
  X11Forwarding no
```
- additional recommended change
```
PermitRootLogin no
AllowGroups wheel jailed
```

{'fraction_non_alphanumeric': 0.10135135135135136, 'fraction_numerical': 0.0016891891891891893, 'mean_word_length': 4.537383177570093, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5020926', 'n_tokens_mistral': 358, 'n_tokens_neox': 334, 'n_words': 153}