Chrooter un user dans une cage

Adminstration Server Linux Add comments

On install les paquets

apt-get install sudo debianutils coreutils

On se met dans dans le dossier /usr/local/sbin, download le script et lui donne les droits d’exécution

cd /usr/local/sbin
wget http://www.majorxtrem.be/wp-content/uploads/2009/04/make_chroot_jail.sh
chmod 700 /usr/local/sbin/make_chroot_jail.sh

Il suffit maintenant de lancer la commande suivante pour créer un utilisateur

make_chroot_jail

Voici le r ésultat

# make_chroot_jail gora
Release: 2007-10-19
Am I root?
OK
Checking distribution...
Supported Distribution found
System is running Debian Linux
Checking for which...
OK
Checking for chroot...
OK
Checking for sudo...
OK
Checking for dirname...
OK
Checking for awk...
OK
Creating /bin/chroot-shell
Creating /home/jail
Creating /home/jail/dev
Creating /home/jail/etc
Creating /home/jail/etc/pam.d
Creating /home/jail/bin
Creating /home/jail/home
Creating /home/jail/sbin
Creating /home/jail/usr
Creating /home/jail/usr/bin
Creating /home/jail/usr/lib
Modifying /etc/sudoers
Adding User "gora" to system
Entrez le nouveau mot de passe UNIX :
Retapez le nouveau mot de passe UNIX :
passwd : le mot de passe a ét é mis à jour avec succ ès
Adding User gora to jail
Copying necessary library-files to jail (may take some time)
Copying files from /etc/pam.d/ to jail
Copying PAM-Modules to jail

Leave a Reply

*

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Connexion
ipv6 ready