Can ping Centos7 in VM but cant SSH, Not SSH Daemon or Firewall issue..HELP!!

Issues related to configuring your network
Post Reply
sunmiller
Posts: 3
Joined: 2017/05/11 17:46:30

Can ping Centos7 in VM but cant SSH, Not SSH Daemon or Firewall issue..HELP!!

Post by sunmiller » 2017/05/11 18:23:32

Hi,

New to Centos but after trawling through many forums and posts I've tried everything.. well clearly not everything as I still can't get in. Here is what I've tried so far:
> Installed Centos on VMWare
> Setup static IP on Centos
> Can ping the IP from windows
> Checked the SSH Daemon is running and is listening on port 22
> Stopped the Firewall - both on Centos and on Windows
> Connected to SSH via Putty and obtained a connection

But when I enter the login and password I get the message 'Access Denied'

I am using the same login details as I do when I login through VM (Yes I've checked by typing 'id' on the command line) yet still cannot connect.....

Does anyone have any ideas? :(

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Can ping Centos7 in VM but cant SSH, Not SSH Daemon or Firewall issue..HELP!!

Post by TrevorH » 2017/05/11 19:10:58

My most likely idea is that you have a duplicate ip address on your network so you aren't connecting to the machine you think you are.

If you look in /var/log/secure then all ssh attempts are logged there, even ones that don't work. Check there and see if you see lines at the time when you try to ssh. If you don't see anything then it's likely you're not talking to the machine you think you are. If you do then perhaps they will tell you what the problem is.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

sunmiller
Posts: 3
Joined: 2017/05/11 17:46:30

Re: Can ping Centos7 in VM but cant SSH, Not SSH Daemon or Firewall issue..HELP!!

Post by sunmiller » 2017/05/11 19:25:10

Hi,
I checked that file and tried to SSH but no additional info was added so nothing logged..

I am certainly getting connection to the host but when it tries to authenticate the password I get a 'Access Denied' message

I'm stumped!

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Can ping Centos7 in VM but cant SSH, Not SSH Daemon or Firewall issue..HELP!!

Post by TrevorH » 2017/05/11 19:41:19

Even if you telnet to port 22 on the box and hit enter you should see something in /var/log/secure on the server. I just tried that here and got

Code: Select all

May 11 20:39:27 hostname sshd[16985]: Bad protocol version identification '' from 192.168.x.6 port 35914
If you don't see anything then that makes my duplicate ip address theory even more likely. Try a different fixed ip that you know for sure is not in use and then use arping to ping the other ip - if you get replies to arping then it's in use and you now know its MAC address.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

sunmiller
Posts: 3
Joined: 2017/05/11 17:46:30

Re: Can ping Centos7 in VM but cant SSH, Not SSH Daemon or Firewall issue..HELP!!

Post by sunmiller » 2017/05/11 20:11:09

So I managed to get the issue fixed!!

It was because my sshd_config file was empty! How that happened god only knows, I think I cleared the file when I was messing around with it before..

Managed to recover it from the client package... restarted the sshd daemon and hey presto!!

Thanks very much for your hep anyhow Trevor :-)

Post Reply