EvilZone
Hacking and Security => Hacking and Security => : lucid September 17, 2013, 07:00:38 AM
-
So I've edited /etc/ssh/sshd_config and changed the default port to 13409 and restarted sshd.service file. I've also copied /lib/systemd/system/sshd.socket to /etc/systemd/system/sshd.socket and changed the ListenStream as per the Arch wiki.
[Unit]
Conflicts=sshd.service
Wants=sshdgenkeys.service
[Socket]
ListenStream=13409
Accept=yes
[Install]
WantedBy=sockets.target
Then I went to my other computer and tried to connect:
ssh -p 13409 user@host
But it said connection refused. Sorry for the brief nature of this post. I wasn't really sure how much information was really needed.
-
Sounds like you need to edit the config file differently and then restart your ssh daemon. Edit /etc/ssh/sshd_config by adding 'Port xxx' and then restarting your daemon with `systemctl restart sshd.service`.
If you have two Port entries the service will listen on all ports designated so if you want to use one port exclusively make sure there is only one port entry in the config file.
-
Yes the only thing i had to change/add was Port xxx to sshd_config
-
Sometimes it helps to ssh to yourself before trying another machine.
Just do ssh localhost -p xxx.
Than try another machine.
See if netstat reports listening ports and try some nmap.
-
Well, I've run an nmap scan and it shows that all ports on my device are closed.
Nmap scan report for 192.168.1.37
Host is up (0.000010s latency).
All 1000 scanned ports on 192.168.1.37 are closed
EDIT: I just figured it out. I forgot to change the port forwarding settings on the router. I originally had it forwarding all traffic over port 22 to my IP address, and I forgot to change the port number. All works now, thanks.
-
Well, I've run an nmap scan and it shows that all ports on my device are closed.
Nmap scan report for 192.168.1.37
Host is up (0.000010s latency).
All 1000 scanned ports on 192.168.1.37 are closed
EDIT: I just figured it out. I forgot to change the port forwarding settings on the router. I originally had it forwarding all traffic over port 22 to my IP address, and I forgot to change the port number. All works now, thanks.
Gratz :D Sure do that next time before you change settings. Next time you hide your own server behind a firewall :P
-
+1 for feyodor.
-
Gratz :D Sure do that next time before you change settings. Next time you hide your own server behind a firewall :P
Yeah I should have thought of that sooner, sorry for wasting people's time.
-
Yeah I should have thought of that sooner, sorry for wasting people's time.
All good. You know I did the same thing this weekend when I forgot I changed the static IP of the PC I was trying to SSH into. Since I had changed modems and stopped using the router as an access point, it's rules came into play. Fun stuff!
-
Fun stuff!
Certainly is.