Изменим строчку в sshd_config:
Subsystem sftp /usr/libexec/openssh/sftp-server
на
Subsystem sftp /usr/libexec/openssh/sftp-server -l INFO -f AUTH
Добавим в /etc/rsyslog.conf:
auth.* /var/log/sftp.log
Настроим ротацию /etc/logrotate.d/sftp
/var/log/sftp.log { weekly missingok rotate 30 compress delaycompress postrotate invoke-rc.d rsyslog reload > /dev/null endscript }
Рестартим сервисы:
systemctl restart sshd.service rsyslog.service
admin 25 октября, 2021
netsh interface ip set address name="Local Area Connection" static 192.168.1.15 255.255.255.0 192.168.1.1 netsh interface ip set dns "Local Area Connection" static 8.8.8.8 netsh interface ip set address "Local Area Connection" dhcp Get-WindowsCapability -Online | ? Name -like 'OpenSSH*' Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0 Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 Start-Service sshd # OPTIONAL but recommended: Set-Service -Name sshd -StartupType 'Automatic' # Confirm the Firewall rule is configured. It should be created automatically by setup. Get-NetFirewallRule -Name *ssh* # There should be a firewall rule named "OpenSSH-Server-In-TCP", which should be enabled # If the firewall does not exist, create one New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22 New-NetFirewallRule -DisplayName "Allow inbound ICMPv4" -Direction Inbound -Protocol ICMPv4 -IcmpType 8 -Action Allow
admin 26 декабря, 2020
Posted In: Windows
Метки: firewall, openssh, ssh, windows server