How do I know if my server has SSH? Is there anyway to test?
which ssh would tell you if you have the SSH client installed. But you might be asking whether your server allows you to connect to it using ssh, at which point you are looking for SSH -the SSH daemon- and not SSH itself. If you have it installed should be able to start it with
/etc/init.d/sshd start as root. If you cannot find a similarily named script odds are it's not installed. Most distros should have it installed by default.
telnet <target> 22
The first line should be plaintext telling you about the SSH version.
Also nmap can do
SERVICE/VERSION DETECTION (
-sV: Probe open ports to determine service/version info). That could help you find a misconfigured port (typos hide everywhere, I had ssh runnning on 21 and closed all connections to the server).
Quite an old one but I've just hit this post for the same reason and following on from ArtB's post of
which ssh (outputs /usr/sbin/ssh for my default Ubuntu install) you can also do
which sshd which outputs /usr/sbin/sshd
Though to be honest the best way to see if anything is running on Linux is
ps aux is it not? So in this instance
ps aux | grep sshd, or for those wanting perfection and hiding the grep command
ps aux | grep -v grep | grep sshd, out as follows on my Ubuntu that I've just installed OpenSSH-Server on:
ps aux | grep -v grep | grep sshd
root 5638 0.0 0.1 61372 5532 ? Ss 15:35 0:00 /usr/sbin/sshd -D
If it is a debian derivative (ubuntu, debian, mint) then:
dpkg -l | grep "openssh-server"
Should show you something like:
ii openssh-server 1:7.6p1-4ubuntu0.3 amd64 secure shell (SSH) server, for secure access from remote machines
ii saying it is installed. If it shows nothing, then it isn't.
If you want to know if you have the ssh client, then use
dpkg -l | grep "openssh-client" instead.
One way is to check if you have ssh RPM Package installed
[sanyadav@localhost ~]$ **rpm -qa | grep -i ssh**
libssh2-1.4.3-8.el7.x86_64 openssh-6.6.1p1-11.el7.x86_64 **openssh-server-6.6.1p1-11.el7.x86_64** **openssh-clients-6.6.1p1-11.el7.x86_64**
Further if you want to see version of ssh rpm package installed
[sanyadav@localhost ~]$rpm -qi openssh-clients-6.6.1p1-11.el7.x86_64
Name : openssh-clients Version : 6.6.1p1 Release : 11.el7 Architecture: x86_64