====== SCP-only mit Change Root ====== **Damit das funktioniert, müssen alle benötigten Programmteile (wie zum Beispiel die SHELL) in die ChRoot-Umgebung kopiert werden!** Erstmal muss natürlich das Programm installiert werden: # aptitude -y install scponly Dann muss es für //chroot// um-konfiguriert werden: # dpkg-reconfigure -plow scponly Den ersten von zwei Fehlern im Paket umgeht man so: # ln -s /lib/ld-linux-x86-64.so.2 /lib/ld.so Jetzt können wir den neuen und speziell gesicherten Benutzer anlegen: # cd /usr/share/doc/scponly/setup_chroot/ # ./setup_chroot.sh Next we need to set the home directory for this scponly user. please note that the user's home directory MUST NOT be writeable by the scponly user. this is important so that the scponly user cannot subvert the .ssh configuration parameters. for this reason, a writeable subdirectory will be created that the scponly user can write into. -en Username to install [scponly] fritz -en home directory you wish to set for this user [/home/fritz] -en name of the writeable subdirectory [incoming] DATEN -e creating /home/fritz/DATEN directory for uploading files Your platform (Linux) does not have a platform specific setup script. This install script will attempt a best guess. If you perform customizations, please consider sending me your changes. Look to the templates in build_extras/arch. - joe at sublimation dot org please set the password for fritz: Geben Sie ein neues UNIX Passwort ein: Geben Sie das neue UNIX Passwort erneut ein: passwd: password updated successfully if you experience a warning with winscp regarding groups, please install the provided hacked out fake groups program into your chroot, like so: cp groups /home/fritz/bin/groups Bei 64-Bit-Maschinen geht es immernoch nicht, denn ein letzter Fehler muss erst noch beseitigt werden: # cd /home/fritz/ # mkdir lib64 # cd lib64 # cp /lib64/ld-linux-x86-64.so.2 . Jetzt kann man den Zugang per Browser ganz einfach testen: sftp://fritz:geheimes_passwort@192.168.1.1/DATEN ===== einen Sub-User anlegen ===== Wir möchten einen Sub-User //Fratz// der unterhalb des Home-Verzeichnisses von //Fritz// liegt, anlegen. # cd /usr/share/doc/scponly/setup_chroot/ # ./setup_chroot.sh Next we need to set the home directory for this scponly user. please note that the user's home directory MUST NOT be writeable by the scponly user. this is important so that the scponly user cannot subvert the .ssh configuration parameters. for this reason, a writeable subdirectory will be created that the scponly user can write into. -en Username to install [scponly] fratz -en home directory you wish to set for this user [/home/fratz] /home/fritz/DATEN/fratz -en name of the writeable subdirectory [incoming] DATEN -e creating /home/fritz/DATEN/fratz/DATEN directory for uploading files Your platform (Linux) does not have a platform specific setup script. This install script will attempt a best guess. If you perform customizations, please consider sending me your changes. Look to the templates in build_extras/arch. - joe at sublimation dot org please set the password for fratz: Geben Sie ein neues UNIX Passwort ein: Geben Sie das neue UNIX Passwort erneut ein: passwd: password updated successfully if you experience a warning with winscp regarding groups, please install the provided hacked out fake groups program into your chroot, like so: cp groups /home/fritz/DATEN/fratz/bin/groups Den bekannten 64-Bit-Bug beheben: # cd /home/fritz/DATEN/fratz/ # mkdir lib64 # cd lib64 # cp /lib64/ld-linux-x86-64.so.2 . Jetzt müssen wir noch dafür sorgen, dass Fritz Daten in das Verzeichnis von Fratz reinschreiben darf, damit ein Datenaustausch möglich wird. chmod 0775 /home/fritz/DATEN/fratz/DATEN chgrp fritz /home/fritz/DATEN/fratz/DATEN Wenn man jetzt meherere Sub-User von //Fritz// anlegt (wie z.B. Fratz), dann kann //Fritz// mit allen Sub-Usern Daten austauschen. Die Sub-User können dagegen keine Daten untereinander austauschen. ===== Client ===== Windows-User können [[https://winscp.net/eng/docs/project_history|WinSCP]] nutzen.