How do I install ssh under Linux operating systems?
Linux operating system comes with OpenSSH client and server as follows from OpenBSD project:
How do I install ssh under RHEL / SL (Scientific Linux) / CentOS / Fedora Linux?
Type the following yum command to install ssh client and server:
# yum -y install openssh-server openssh-clients
Start and enable sshd server:
# chkconfig sshd on
# service sshd start
Open port 22 for all IP address, enter:
# /sbin/iptable -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
# service iptables save
You can set an appropriate network block/mask, representing the machines on your network which must be allowed to access this SSH server. In this example open port 22 to only subnet 192.168.1.0/24:
# /sbin/iptables -A INPUT -s 192.168.1.0/24 -m state --state NEW -p tcp --dport 22 -j ACCEPT
# service iptables save
To configure OpenSSH server edit /etc/ssh/sshd config file. Please go though these recommendations to improve security of SSHD server. You can also go through sshd_config(5) man page for more detailed information:
$ man 5 sshd_config
How do I install ssh under Ubuntu / Debian Linux?
See our “Debian Linux Install OpenSSH SSHD Server” article for more information.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
- RSS feed or Weekly email newsletter
- Share on Twitter • Facebook • 1 comment... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
tx man :)