SSH

SSH (secure shell) сервис обеспечивает:
SFTP (secure file transfer protocol)
SCP (secure copy)
X11 forwarding
SSHFS (SSH File System) можно примонтировать файловую систему ч/з SSH

Проверим установлени ли SSH клиент
#ssh -v

Если нет, то скачиваем и устанавливаем
# yum -y install openssh-server openssh-clients

Запускаем и добавляем в автозагрузку
# chkconfig sshd on
# systemctl start sshd


Надо попробовать подключиться по SSH и 22 порту (по дефолту), если все работает, то ок, если нет, то ниже инструкции по firewall и добавлению нового порта, по изменению настроек


Firewall Settings
Edit /etc/sysconfig/iptables (IPv4 firewall),
# vi /etc/sysconfig/iptables
Add the line
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
If you want to restict access to 192.168.1.0/24, edit it as follows:
-A RH-Firewall-1-INPUT -s 192.168.1.0/24 -m state --state NEW -p tcp --dport 22 -j ACCEPT

Save and close the file. Restart iptables:
# service iptables restart

OpenSSH Server Configuration

Edit /etc/ssh/sshd_config, enter:
# vi /etc/ssh/sshd_config
To disable root logins, edit or add as follows:
PermitRootLogin no
Restrict login to user tom and jerry only over ssh:
AllowUsers tom jerry
Change ssh port i.e. run it on a non-standard port like 1235
Port 1235
Save and close the file. Restart sshd:
# service sshd restart

Comments

Popular posts from this blog

Петли L2, методы борьбы (PortFast, LoopGuard, BPDU guard, BPDU filter)

Проброска static маршрута в OSPF

EtherChannel