doc:appunti:linux:sa:ssh
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
doc:appunti:linux:sa:ssh [2022/02/11 10:58] – [sftp e rssh] niccolo | doc:appunti:linux:sa:ssh [2022/02/11 11:30] (current) – [rush] niccolo | ||
---|---|---|---|
Line 16: | Line 16: | ||
In **Debian 10 Buster** non esiste il pacchetto **rssh**, al suo posto troviamo **rush**. Segue una breve ricetta su come attivare un ambiente **rush** per un utente, limitato a **ricevere dei file via sftp**. | In **Debian 10 Buster** non esiste il pacchetto **rssh**, al suo posto troviamo **rush**. Segue una breve ricetta su come attivare un ambiente **rush** per un utente, limitato a **ricevere dei file via sftp**. | ||
+ | |||
+ | Si installa il server SFTP: | ||
< | < | ||
+ | apt install openssh-sftp-server | ||
+ | </ | ||
+ | |||
+ | quindi si prepara un ambiente chroot che servirà a tenere confinato l' | ||
+ | |||
+ | < | ||
+ | apt install rush | ||
+ | adduser --uid 1004 --gecos " | ||
mkdir -p /srv/rush/ | mkdir -p /srv/rush/ | ||
debootstrap buster /srv/rush/ | debootstrap buster /srv/rush/ | ||
+ | </ | ||
+ | |||
+ | Nell' | ||
+ | |||
+ | < | ||
+ | chroot /srv/rush | ||
+ | |||
+ | apt install locales | ||
+ | dpkg-reconfigure locales | ||
+ | apt install openssh-sftp-server | ||
+ | adduser --uid 1004 --gecos " | ||
+ | </ | ||
+ | |||
+ | Il file **/ | ||
+ | |||
+ | < | ||
+ | rule sftp-rush | ||
+ | command ^.*/ | ||
+ | uid >= 1000 | ||
+ | set[0] / | ||
+ | umask 002 | ||
+ | chroot /srv/rush | ||
+ | chdir ~ | ||
+ | </ | ||
+ | |||
+ | Si dovrebbe quindi poter accedere via **sftp**, ma fallire via **ssh**: | ||
+ | |||
+ | < | ||
+ | sftp -P 22 sftp-user@remote.host.com | ||
+ | sftp-user@remote.host.com' | ||
+ | Connected to sftp-user@remote.host.com. | ||
+ | sftp> | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | ssh -p 22 sftp-user@remote.host.com | ||
+ | sftp-user@remote.host.com' | ||
+ | You do not have interactive login access to this machine. | ||
+ | Contact the systems administrator for further assistance. | ||
+ | Connection to remote.host.com closed. | ||
</ | </ | ||
doc/appunti/linux/sa/ssh.1644573480.txt.gz · Last modified: 2022/02/11 10:58 by niccolo