SSH wont log in remotely

Soldato
Joined
26 Feb 2007
Posts
8,550
Hi All,

Having a bit of an issue logging in remotely to a pi running Raspbian Jessie Lite, I can access it fine via the local network, but when I try remotely I get 'access denied'. But...I can log in if I change the external port on the router (so port 120 resolves to port 22 internally.

This was sort of fine, but I'm trying to setup ssh keys from a pi on my local network to the remote pi I'm having issues with in the above paragraph. Using the 'cat' command to send the keys made on my pi, I am required to log in to the remote one, when I do I get the 'access denied' error.

Now I'm pretty sure that tomorrow when I take the pi out and try it later on at home that I will be able to send the keys over the lan but the question remains, why do I get access denied when sending stuff remotely? Is it to do with how I'm port forwarding? I haven't set any security stuff up in the pi as far as I know.

I hope some of that makes sense, let me know if there is any more info I can give!
 
What I'm saying is that port forwarding only works if I choose a different external port, so if I forward port 22 externally to port 22 on the pi, I still get asked for my password by the pi but I then get 'access denied', but if I choose a different external port then I can login fine. More of a quirk than anything.

I've setup keys now, I found that I hadn't specified the port on the cat transfer :/ so will do as disable other forms of login.

Ideally what I want is a central pi at home that all the others connect to automatically via ssh tunnel using keys, then this should allow me to access them without requiring port forwarding etc at the remote sites. (This is so I can proxy across to lan devices for fault finding etc).
 
Maybe it's just the the forwarding isn't working correctly and I assumed it was the pi being odd. Will try on a different router..

I haven't got the documentation, but when I sent the keys over I had to initiate an ssh connection to the remote pi to send them over and that failed because I forgot to specify the port.

I think I'm going to start again as I've been messing around with keys and stuff so much that I'm not sure what stage I'm at now!

What I want is a proxy device I can leave on site, but doesn't require port forwarding etc. This is to be achieved by the remote pi setting up an ssh tunnel (I think) to my office pi which can then access the proxy using this, I think?
 
Back
Top Bottom