it-wiki:linux:ssh_chrooted_jail
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| it-wiki:linux:ssh_chrooted_jail [2021/03/10 20:59] – [Step 6. Create SSH User’s Home Directory and Add Linux Commands] marko | it-wiki:linux:ssh_chrooted_jail [2021/03/10 21:06] (aktuell) – [Step 7. Testing SFTP with Chroot Jail] marko | ||
|---|---|---|---|
| Zeile 130: | Zeile 130: | ||
| **13.** Next, check the shared libraries for the commands above and move them into the chrooted jail libraries directory: | **13.** Next, check the shared libraries for the commands above and move them into the chrooted jail libraries directory: | ||
| + | <code bash> | ||
| + | # ldd /bin/ls | ||
| + | # cp -v / | ||
| + | </ | ||
| + | {{ : | ||
| + | |||
| + | ==== Step 7. Testing SFTP with Chroot Jail ==== | ||
| + | **14.** Do a final test using sftp; check if the commands you have just installed are working. | ||
| + | |||
| + | Add the line below in the ''/ | ||
| + | <code bash> | ||
| + | #Enable sftp to chrooted jail | ||
| + | ForceCommand internal-sftp | ||
| + | </ | ||
| + | |||
| + | Save the file and exit. Then restart the SSHD services: | ||
| + | <code bash> | ||
| + | # systemctl restart sshd | ||
| + | </ | ||
| + | |||
| + | **15.** Now, test using SSH, you’ll get the following error: | ||
| + | <code bash> | ||
| + | # ssh tecmint@192.168.0.10 | ||
| + | </ | ||
| + | {{ : | ||
| + | |||
| + | Try using SFTP as follows: | ||
| + | < | ||
| + | # sftp tecmint@192.168.0.10 | ||
| + | </ | ||
| + | {{ : | ||
| + | |||
it-wiki/linux/ssh_chrooted_jail.1615409964.txt.gz · Zuletzt geändert: von marko