SSHd giving me the blank stare
Just installed a fresh Arch on a remote server. Changed sshd port to 22555 - Tried to connect via putty but Im just getting a blank screen.
Cant find the /var/log/secure log, but journalctl -u sshd just confirms that the server is running, and netstat -lnput confirms that its listning on 22555.
Where should I be looking for clues?
Update
I've tried reinstalling again, just to eliminate anthing I might have done wrong during the process. When the system boots everything works fine, but after running af pacman -Syu, changing the port in sshd_config, followed by a systemctl reload sshd, I get this
[root@ssh]# systemctl reload sshd Error getting authority: Error initializing authority: Error calling StartServiceByName for org.freedesktop.PolicyKit1: Timeout was reached (g-io-error-quark, 24)
Updated with Solution:
It seems that after rebooting, Linodes own nameservers didn't work. Changing to Googles DNS servers in Resolv.conf fixed everything.
Edited 19 Jan 2016. We only hold this version.
About this post
- Posted
- Archived
- Edited
- Score
- 15 · 100% up
- Kind
- Text
- ID
- 41psyg
26 comments
Sounds like you might be on a Windows box (putty). You could try
telneting to the arch box and see what it's returning on the connection attempt: (Note the SSH-2.0-OpenSSH_7.1)If you can get access to a Linux box you can also try doing a port scan with something like
nmapto check the port is open:Good luck!
Could you offer me the 2nd clue? I've tried nmap now, and the port is not responding, despite Netstat claiming that its open for business
try doing a tcpdump on the server
while that is running, attempt a connection from your remote machine and see if the traffic is picked up as it is reaching your server.
if it is not, you have a network issue somewhere.
Aaah - This provided a huge hint. tcpdump wasn't installed, so I tried pacman -S tcpdump. It failed to resolve hosts. Tried ping google.com and the same happend. It seems somehow, that after the first reboot, the system has lost internet connectivity. Any idea on how to restore that on a linode?
Sorry I never used Linode, but i'd try and ifdown/ifup first, if that don't work, have a look through /var/log/dmesg for anything relevant.
Or rather, without using deprecated command :
Just FYI, running ssh on a port higher than 1024 is not generally recommended. Only root can start services listening below 1024, but any user can listen on ports above. That means, should anyone gain access, they could potentially crash sshd and start their own service on that port, enabling them to wait for connections and harvest passwords for example.
Although host keys won't match
Fantastic tip, thanks!
the service is probably running but did you make sure to enable traffic to that port via iptables? If you're using a nonstandard port you'll need to let the box know:
then restart sshd.
you can make sure you've got the right rules in place:
I've run into this a bunch locking down my hosted stuff :-p
edit: journalctl is fine but it also helps to
systemctl status sshdas welllots of folks sure are suggesting a ton of network troubleshooting but it sounds like you've already been over that :-p
I added the rule. Confirmed it was there with -L -n. Restarted sshd. Status confirms its running, netstat confirms its listning and still I just get a blank screen and cant connect from the outside.
Any other options?
could you provide a pastebin of the terminal showing the steps you took (with any sensitive info redacted of course) I like ix.io or sprunge.us
there are a few things I'm thinking it could be:
if you've got nmap and you want to see if it's perhaps a cipher issue try running this:
it'll enumerate all supported ciphers on the box. if you're openssl config is severely limited it could cause an issue. (maybe they don't like RC4? :-p)
Can you access the server via VNC? Try ssh'ing localhost to see if it is a network or server problem.
VNC is not an option, but ssh -p 22555 localhost works
Is it listening on all addresses, or just localhost?
You said remote server, how did you do the install? How are you accessing the journal without ssh? Do you have physical access? Is other networking working on the server? Does it work with a different port? Are you connecting over LAN or WAN?
I deployed an image on Linode. Please see update above
Did you actually enable and start the service?
systemctl start sshd?
Yes
What's your version of systemd? Have you tried making sure you're up to date before you change things? There have been some bugs in systemd.
Connection -> SSH -> Kex: Move Diffie-Hellman group exchange all the way down, see if it helps.
No difference
Installed arch today. Putty couldn't connect. Checked logs, immediately remembered this. Working fine now.