====== SSH ====== ===== Login via chave pública ===== Liberando o arquivo de chaves públicas (para rodar o ''authorized_keys'' no SELinux) # restorecon -v -r /root/.ssh Para configurar o servidor SSH para só aceitar conexões via chave (sem senha), deve alterar no arquivo ''/etc/ssh/sshd_config'': PermitRootLogin without-password ===== Alterando a porta ===== ==== iptables (CentOS 6) ==== Alterar o arquivo ''/etc/sysconfig/iptables'' (trocar porta 22 pela porta desejada) Reiniciar o ''iptables'': service iptables restart ==== firewalld (CentOS 7) ==== Copiar o arquivo ''ssh.xml'' e alterar a porta neste arquivo: # cp /usr/lib/firewalld/services/ssh.xml /etc/firewalld/services/ [...] [...] Alterar no arquivo ''/etc/ssh/sshd_config'': Port [PORTA] Instalar o pacote ''policycoreutils-python'' (SELinux policy core python utilities). E rodar o comando: # semanage port -a -t ssh_port_t -p tcp [PORTA] Recarregar o ''firewalld'': # firewall-cmd --reload