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 11:22] – [rush] niccolo | doc:appunti:linux:sa:ssh [2025/11/28 12:04] (current) – [rush] niccolo | ||
|---|---|---|---|
| Line 27: | Line 27: | ||
| < | < | ||
| apt install rush | apt install rush | ||
| - | adduser --uid 1004 --gecos " | + | adduser --uid 1004 --gecos " |
| + | | ||
| + | echo 'sftp-user: | ||
| mkdir -p /srv/rush/ | mkdir -p /srv/rush/ | ||
| debootstrap buster /srv/rush/ | debootstrap buster /srv/rush/ | ||
| Line 40: | Line 42: | ||
| dpkg-reconfigure locales | dpkg-reconfigure locales | ||
| apt install openssh-sftp-server | apt install openssh-sftp-server | ||
| - | adduser --uid 1004 --gecos " | + | adduser --uid 1004 --gecos " |
| + | | ||
| </ | </ | ||
| Line 46: | Line 49: | ||
| < | < | ||
| - | # Sftp-server requests: chroot to the virtual server, change to the user's | ||
| - | # home directory, set umask to 002 and execute only | ||
| - | # / | ||
| - | # | ||
| - | # Setting for a chroot directory created using ' | ||
| - | # | ||
| - | # Remark: The location '/ | ||
| - | |||
| rule sftp-rush | rule sftp-rush | ||
| command ^.*/ | command ^.*/ | ||
| Line 62: | Line 57: | ||
| chdir ~ | chdir ~ | ||
| </ | </ | ||
| + | |||
| + | :!: **ATTENZIONE**: | ||
| + | |||
| + | < | ||
| + | rush 2.0 | ||
| + | |||
| + | global | ||
| + | debug 2 | ||
| + | |||
| + | rule sftp-rush | ||
| + | match $command ~ " | ||
| + | set program = "/ | ||
| + | umask 002 | ||
| + | chroot "/ | ||
| + | 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. | ||
| + | </ | ||
| ===== SSH su Windows ===== | ===== SSH su Windows ===== | ||
doc/appunti/linux/sa/ssh.1644574974.txt.gz · Last modified: by niccolo
