SSH server in Debian now support in config Include /etc/ssh/sshd_config.d/*.conf and if I use different port in my own file (override base config) in sshd_config.d dir this file is ignored by filegator
if ( !isset($_SESSION['SFTP_PORT']) ) {
if( preg_match('/^\s*Port\s+(\d+)$/im', file_get_contents('/etc/ssh/sshd_config'), $matches) ) {
$_SESSION['SFTP_PORT'] = $matches[1] ?? 22;
} else {
$_SESSION['SFTP_PORT'] = 22;
}
}
Maybe it will help someone