You are not logged in.

#1 2016-01-08 17:53:22

bakteria
Member
Registered: 2015-12-15
Posts: 35

Can't SSH remotely before login in locally

I've asked around on IRC and searched around but I cannot find any information on how to solve this.'

If I try and connect remotely I just get connection refused. If I login locally it just works. I can then log out locally and it still works.
I am running ssh with systemd.

I have also checked the boot journal and there is nothing there about ssh that strikes me.

Last edited by bakteria (2016-01-08 18:03:32)

Offline

#2 2016-01-08 20:00:30

paulkerry
Member
From: Sheffield, UK
Registered: 2014-10-02
Posts: 611

Re: Can't SSH remotely before login in locally

Is sshd running?

systemctl status sshd

Also do you have a firewall on either system that might be stopping connections?

If you are trying to login as "root" using ssh, that might not work depending what the "PermitRootLogin" line is set to in /etc/ssh/sshd_config at the server end.

edit: forgot to ask if Arch is the client or the server? What is the other machine running? Also does "ssh -v {hostname}" give you anything helpful?

Last edited by paulkerry (2016-01-08 20:23:10)

Offline

#3 2016-01-08 21:48:49

bakteria
Member
Registered: 2015-12-15
Posts: 35

Re: Can't SSH remotely before login in locally

paulkerry wrote:

Is sshd running?

systemctl status sshd

Also do you have a firewall on either system that might be stopping connections?

If you are trying to login as "root" using ssh, that might not work depending what the "PermitRootLogin" line is set to in /etc/ssh/sshd_config at the server end.

edit: forgot to ask if Arch is the client or the server? What is the other machine running? Also does "ssh -v {hostname}" give you anything helpful?

I am not trying to log in as root. PermitRootLogin is turned off and I'm using cert sign in.
Both client and server are Arch.
The strange part is that its not happening every time I reboot.

Offline

#4 2016-01-08 22:05:02

paulkerry
Member
From: Sheffield, UK
Registered: 2014-10-02
Posts: 611

Re: Can't SSH remotely before login in locally

bakteria wrote:

The strange part is that its not happening every time I reboot.

Server or client reboot? Sanity check: are you trying to connect via IP address and is the server getting a different IP address on reboot?

Edit: Another thought - are you using an encrypted home directory?

Last edited by paulkerry (2016-01-08 22:07:40)

Offline

#5 2016-01-09 11:07:44

bakteria
Member
Registered: 2015-12-15
Posts: 35

Re: Can't SSH remotely before login in locally

paulkerry wrote:
bakteria wrote:

The strange part is that its not happening every time I reboot.

Server or client reboot? Sanity check: are you trying to connect via IP address and is the server getting a different IP address on reboot?

Edit: Another thought - are you using an encrypted home directory?

Server reboot. The IP adress is a assigned adress from pfsense. It does not change.
I do not use an encrypted home directory.

Offline

#6 2016-01-09 11:36:57

cafe
Member
From: Brasil
Registered: 2014-03-20
Posts: 165

Re: Can't SSH remotely before login in locally

Looks like your router is blocking the port you specified for ssh. You should configure your router's firewall and port forwarding to match your server's configuration

Offline

#7 2016-01-09 11:42:24

bakteria
Member
Registered: 2015-12-15
Posts: 35

Re: Can't SSH remotely before login in locally

cafe wrote:

Looks like your router is blocking the port you specified for ssh. You should configure your router's firewall and port forwarding to match your server's configuration

I do not belive this is the case. After I log in locally to my server. I can ssh in remotely without issues.

Offline

#8 2016-01-10 18:50:37

paulkerry
Member
From: Sheffield, UK
Registered: 2014-10-02
Posts: 611

Re: Can't SSH remotely before login in locally

as I asked earlier, what is the output of...

systemctl status sshd

does this give you anything at all from your client...

ssh -v server

and does ssh'ing in as root from your client work if you change the relevant line in /etc/ssh/sshd_config and restart sshd on your server (if yes, this would indicate it's a per user problem rather than a system-wide problem)?

Last edited by paulkerry (2016-01-10 22:01:42)

Offline

Board footer

Powered by FluxBB