Skip to content

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.

15 points26 comments
Open on Reddit
About this post
Posted
Archived
Edited
Score
15 · 100% up
Kind
Text
ID
41psyg

Author

2
posts
12
comments
0
media
View profile

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)

$ telnet arch-box.example.com 22555
Trying W.X.Y.Z...
Connected to arch-box.example.com.
Escape character is '^]'.
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 nmap to check the port is open:

$ nmap arch-box.example.com -p 22555       
Starting Nmap 7.01 ( https://nmap.org ) at 2016-01-19 12:12 CST
Nmap scan report for arch-box.example.com (W.X.Y.Z)
Host is up (0.046s latency).
PORT   STATE SERVICE
22555/tcp open  ssh

Nmap done: 1 IP address (1 host up) scanned in 0.11 seconds

Good luck!

5 points

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

1 points

try doing a tcpdump on the server

tcpdump -i <yourinterface> -nnvvSs 0 port 22555

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.

2 points

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?

2 points

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 :

ip link set eth0 down
ip link set eth0 up
1 points

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.

2 points

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:

iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 22555 -j ACCEPT

then restart sshd.

you can make sure you've got the right rules in place:

sudo iptables -L -n

I've run into this a bunch locking down my hosted stuff :-p

edit: journalctl is fine but it also helps to systemctl status sshd as well

lots of folks sure are suggesting a ton of network troubleshooting but it sounds like you've already been over that :-p

1 points

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?

1 points

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:

  • sshd_config doesn't have you as an allowed user, or doesn't specify accepting connections from your IP
  • you've somehow gotten yourself to use some wonky enc. algo's that are not supported by one side.
  • the routing table on the instance isn't forwarding traffic to the new port
  • linode has some sort of network security object like an AWS-style ACL or Security Group in place that needs to be opened up

if you've got nmap and you want to see if it's perhaps a cipher issue try running this:

nmap --script ssl-enum-ciphers -p <port> <host>

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)

1 points

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?

1 points

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.

1 points

Connection -> SSH -> Kex: Move Diffie-Hellman group exchange all the way down, see if it helps.

0 points

Installed arch today. Putty couldn't connect. Checked logs, immediately remembered this. Working fine now.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.