This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
сервис_ssh [2024/03/14 11:07] val |
сервис_ssh [2024/05/15 13:02] (current) val [Использование SSH Chroot] |
||
---|---|---|---|
Line 40: | Line 40: | ||
===== Настройка ssh сервера ===== | ===== Настройка ssh сервера ===== | ||
<code> | <code> | ||
- | gate# cat /etc/ssh/sshd_config | + | gate# cat /etc/ssh/sshd_config.d/my.conf |
</code><code> | </code><code> | ||
- | ... | ||
Port 2222 | Port 2222 | ||
- | ... | + | |
DenyUsers "user*" | DenyUsers "user*" | ||
- | ... | + | |
PermitRootLogin yes | PermitRootLogin yes | ||
- | ... | + | |
#KexAlgorithms +diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1 | #KexAlgorithms +diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1 | ||
#HostkeyAlgorithms +ssh-dss,ssh-rsa | #HostkeyAlgorithms +ssh-dss,ssh-rsa | ||
- | ... | ||
</code> | </code> | ||
Line 88: | Line 86: | ||
# StrictHostKeyChecking=no | # StrictHostKeyChecking=no | ||
# LogLevel ERROR | # LogLevel ERROR | ||
+ | |||
+ | ### HostKeyAlgorithms +ssh-rsa | ||
+ | ### PubkeyAcceptedKeyTypes +ssh-rsa | ||
</code> | </code> | ||
Line 127: | Line 128: | ||
<code> | <code> | ||
- | www# cat /etc/ssh/sshd_config | + | # cat /etc/ssh/sshd_config |
</code><code> | </code><code> | ||
... | ... | ||
Line 134: | Line 135: | ||
... | ... | ||
Match group user1 | Match group user1 | ||
+ | #Match group group1 | ||
ChrootDirectory %h | ChrootDirectory %h | ||
ForceCommand internal-sftp | ForceCommand internal-sftp | ||
</code><code> | </code><code> | ||
- | www# chown root ~user1/ | + | # chown root ~user1/ |
- | www# mkdir ~user1/public_html | + | # mkdir ~user1/public_html && chown user1:user1 ~user1/public_html/ |
- | www# chown -R user1:user1 ~user1/public_html/ | + | # mkdir ~user1/mail && chown user1:user1 ~user1/mail/ |
</code> | </code> | ||
Line 185: | Line 187: | ||
</code><code> | </code><code> | ||
# cat /proc/sys/net/ipv4/ip_local_port_range | # cat /proc/sys/net/ipv4/ip_local_port_range | ||
+ | или | ||
+ | # sysctl net.ipv4.ip_local_port_range | ||
+ | |||
+ | lan# ssh -N -R 61022:localhost:22 -o ServerAliveInterval=60 student@server.corpX.un | ||
+ | |||
+ | lan# ssh -N -R 61389:192.168.100+X.1NN:3389 student@server.corpX.un | ||
- | lan# ssh -N -R 61022:localhost:22 -o ServerAliveInterval=60 user1@server.corpX.un | + | mobaxterm> ssh -N -R 61389:localhost:3389 student@server.corpX.un |
- | lan# ssh -N -R 3101:192.168.100+X.101:3389 user1@server.corpX.un | + | mobaxterm> ssh -N -R 0:localhost:5500 student@server.corpX.un |
</code> | </code> | ||