How to Install and Configure OpenSSH Server In Linux
To Install and Configure OpenSSH Server In Linux
OpenSSH is an open source which is freeware tool that uses the ssh protocol and provide secure encrypted communication over a computer network. Thistutorial covers the ground on how to install and configure the OpenSSH server in Linux.
Advantages of OpenSSH
- All communications and user credentials using OpenSSH are encrypted and protected.
- It detects and informs, if a third party tries to intercept your connection.
Features of the OpenSSH
- Agent Forwarding (Single-Sign-On)
- Interoperability (Compliance with SSH 1.3, 1.5, and 2.0 protocol Standards)
- Port Forwarding (encrypted channels for legacy protocols)
- Strong Authentication (Public Key, One-Time Password and Kerberos Authentication)
- SFTP client and server support in both SSH1 and SSH2 protocols
- Kerberos and AFS Ticket Passing
- Data Compression
- Secure Communication
- Strong Encryption (3DES, Blowfish, AES, Arcfour)
- X11 Forwarding (encrypt X Window System traffic)
To Install OpenSSH in Linux
Execute the following commands with super user permissions.
For Ubuntu/Debian/Linux Mint
$ sudo apt-get install openssh-server openssh-client
For RHEL/Centos/Fedora
[root@linuxhelp ~]# yum -y install openssh-server openssh-clients
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: centos.excellmedia.net
* epel: mirror.wanxp.id
* extras: centos.excellmedia.net
* updates: centos.excellmedia.net
Resolving Dependencies
--> Running transaction check
---> Package openssh-clients.x86_64 0:5.3p1-114.el6_7 will be installed
---> Package openssh-server.x86_64 0:5.3p1-114.el6_7 will be installed
.
.
.
Installed:
openssh-clients.x86_64 0:5.3p1-114.el6_7 openssh-server.x86_64 0:5.3p1-114.el6_7
Complete!
Now the installation of OpenSSH is completed.
To Configure OpenSSH
Before configuration take a backup of the file and start proceeding.
Run the following command to take a copy of the original sshd configuration file.
[root@linuxhelp ~]# cp /etc/ssh/sshd_config /etc/ssh/sshd_config.backup_copy
To Connect OpenSSH
Try to connect to the openssh server from your local host through openssh client or do portscan with nmap, just to verify openssh server is working or not.
Here we are using netcat(nc) command to verify.
[root@linuxhelp ~]# nc -v -z 127.0.0.122
Connection to 127.0.0.1 22 port [tcp/ssh] succeeded!
Now, Open the sshd_config file in text editor and change the port directive to 14 and restart the OpenSSH server.
[root@linuxhelp ~]# vim /etc/ssh/sshd_config Change the default port no 22 to 14 save and exit from the file [root@linuxhelp ~]# service sshd restart
Now, verify the port using nc command.
[root@linuxhelp ~]# nc -v -z 127.0.0.1 14
Connection to 127.0.0.1 14 port [tcp/*] succeeded!
If you want to show some login banners.. then modify the content of /etc/issue.net file by adding the following line inside the sshd configuration file.
[root@linuxhelp ~]# vim /etc/ssh/sshd_config
(Add the below line at the end of the configuration file)
Banner /etc/issue.net
Save and exit from the file.
Comments ( 0 )
No comments available