Home » Kali Linux remote SSH – How to configure openSSH server

Kali Linux remote SSH – How to configure openSSH server

by blackMOREOps
37 comments

Secure Shell (SSH) is a cryptographic network protocol for secure data communication, remote command-line login, remote command execution, and other secure network services between two networked computers. It connects, via a secure channel over an insecure network, a server and a client running SSH server and SSH client programs, respectively. The protocol specification distinguishes between two major versions that are referred to as SSH-1 and SSH-2.

The best-known application of the protocol is for access to shell accounts on Unix-like operating systems, but it can also be used in a similar fashion for accounts on Windows. It was designed as a replacement for Telnet and other insecure remote shell protocols such as the Berkeley rsh and rexec protocols, which send information, notably passwords, in plaintext, rendering them susceptible to interception and disclosure using packet analysis.The encryption used by SSH is intended to provide confidentiality and integrity of data over an unsecured network, such as the Internet.

You can use your Android phone, remote computer, iPAD or anything to login to a SSH server and execute command as if you’re sitting on that workstation. So let’s see how you can install a SSH server (we will be using openSSH-Server here) on Kali Linux. After this guide you will be able to do the followings:

  1. Install Kali Linux remote SSH – openSSH server
  2. Enable Kali Linux remote SSH service on boot
  3. Change Kali default ssh keys to avoid MITM attack
  4. Set MOTD – Message of the Day message with a nice ASCII
  5. Troubleshoot and fix “WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED” error during SSH session.
  6. Change SSH server port for extra safety

Step 1: Install Kali Linux remote SSH – openSSH server

Issue the following command on Kali Linux terminal to install openssh-server.

root@kali~:# apt-get install openssh-server

Kali Linux remote SSH - How to configure openSSH server - blackMORE Ops -1

Now the next logical step is to enable ssh server (as you can see I’ve issued the following command above).

root@kali~:# service ssh start

It works, but there’s a problem. If you restart your Kali Linux machine, SSH server will be disabled.

So we will ensure that SSH server remains up and running all the time (even after restart). Please note that if you don’t want this to happen, then skip Step 2 and move to Step 3. Why? Because if you enable SSH server on your machine, that means your machine will be available via internet and anyone who knows your password (or your password is just ‘123’ or ‘password’ can break into your machine). So use a secured password and if not sure skip to Step 3 for now. Anyway, moving on..

Step 2: Enable Kali Linux remote SSH service

Now we are about to enable SSH service and keep that running the whole time. (changes wont get lost after boot).

First of all remove run levels for SSH.

root@kali~:# update-rc.d -f ssh remove

Next load SSH defaults to run level

root@kali~:# update-rc.d -f ssh defaults

Check if SSH service is up and running

root@kali~:# chkconfig ssh

Kali Linux remote SSH - How to configure openSSH server - blackMORE Ops -3

If you don’t have chkconfig installed, install via

root@kali~:# apt-get install chkconfig

You can run chkconfig to see a lot more too:

root@kali~:# chkconfig -l ssh
(or)
root@kali~:# chkconfig -l

You may also like

37 comments

Kevin Goldstein December 21, 2018 - 4:29 pm

Anybody have any words of advice on how to perform a remote SSH session with Kali 2018.4 with an IPv6 address? Nowhere can I find an actual guide or word of help on the internet…

Reply
1 2

Leave your solution or comment to help others. Comment don't need registration or real email, so feel free.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About Us

blackMORE Ops - touch-icon-72x72

blackMORE Ops” does not promote, encourages and excite hackers, its purpose is to make people aware that what is going around. Know Hacking but No Hacking!

Feature Posts

Newsletter