You are not logged in.

#1 2015-11-17 03:44:14

klever
Member
Registered: 2015-11-17
Posts: 6

[SOLVED] Unable to update ssh port

I'm pretty new to this. I changed the port number in /etc/ssh/sshd_config and uncommented the line. I've also restarted the service with 'systemctl restart sshd.service' as root. I then used 'nmap -P0 localhost' to check if it worked, it did not. I also tried this which I found online 'iptables -I INPUT 1 -p tcp --dport <port #> -j ACCEPT' and retried nmap on it. Still nothing. It no longer shows up on port 22 like it did before but does not show up under the new port #.

Thanks.

Last edited by klever (2015-11-19 02:45:07)

Offline

#2 2015-11-17 06:11:15

pypi
Wiki Maintainer
Registered: 2014-04-22
Posts: 250

Re: [SOLVED] Unable to update ssh port

Are you using the socket service? If so, consider https://wiki.archlinux.org/index.php/Se … shd_daemon; you will also need to edit the socket service file (as explained on the wiki).
By the sounds of it, you aren't. What do the logs for sshd report?

Offline

#3 2015-11-17 06:15:20

ayekat
Member
Registered: 2011-01-17
Posts: 1,616

Re: [SOLVED] Unable to update ssh port

What is the output of this?

systemctl status -l sshd.service

[EDIT] ah, a little late

Last edited by ayekat (2015-11-17 06:15:39)


pkgshackscfgblag

Offline

#4 2015-11-17 08:06:30

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Unable to update ssh port

klever wrote:

I then used 'nmap -P0 localhost' to check if it worked, it did not.

That command doesn't scan all ports (just common low ports i think), try this instead...

nmap -p- localhost

You can also try connecting to the correct port with the ssh command, does it work?

Last edited by Slithery (2015-11-17 08:08:28)


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#5 2015-11-17 08:37:48

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,231
Website

Re: [SOLVED] Unable to update ssh port

Please, for the love of baby kittens stop using nmap to see if a service is listening on a certain port. This is what the `ss` command is for. To see what port SSH is listening on (if any), use `ss -tnlp | grep sshd` and look at the 4th column.

Offline

#6 2015-11-18 01:03:35

klever
Member
Registered: 2015-11-17
Posts: 6

Re: [SOLVED] Unable to update ssh port

slithery wrote:
klever wrote:

I then used 'nmap -P0 localhost' to check if it worked, it did not.

That command doesn't scan all ports (just common low ports i think), try this instead...

nmap -p- localhost

You can also try connecting to the correct port with the ssh command, does it work?

This. This was my issue. Using this instead I can see the port is listening. Now just got to get the host to try connecting on a non 22 port. Thanks.

Offline

#7 2015-11-18 01:04:42

klever
Member
Registered: 2015-11-17
Posts: 6

Re: [SOLVED] Unable to update ssh port

fukawi2 wrote:

Please, for the love of baby kittens stop using nmap to see if a service is listening on a certain port. This is what the `ss` command is for. To see what port SSH is listening on (if any), use `ss -tnlp | grep sshd` and look at the 4th column.

For some reason it's showing my port is listening but it doesn't show up as ssh or sshd so I had to use `ss -tnlp`.

Offline

#8 2015-11-18 01:06:59

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,231
Website

Re: [SOLVED] Unable to update ssh port

klever wrote:

For some reason it's showing my port is listening but it doesn't show up as ssh or sshd so I had to use `ss -tnlp`.

OK... What is listening on that port?

Offline

#9 2015-11-18 01:29:59

klever
Member
Registered: 2015-11-17
Posts: 6

Re: [SOLVED] Unable to update ssh port

fukawi2 wrote:
klever wrote:

For some reason it's showing my port is listening but it doesn't show up as ssh or sshd so I had to use `ss -tnlp`.

OK... What is listening on that port?

`ss -tnlp` returns (the relavent row):
`LISTEN     0    128    *:<port #>    *:*`

I was able to successfully connect through ssh on that port from my laptop.

Offline

#10 2015-11-18 04:39:05

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,231
Website

Re: [SOLVED] Unable to update ssh port

klever wrote:

`ss -tnlp` returns (the relavent row):
`LISTEN     0    128    *:<port #>    *:*`

Oh sorry, I should have specified to run `ss` as root (or using sudo).

klever wrote:

I was able to successfully connect through ssh on that port from my laptop.

Glad it's working. Don't forget to mark your thread as solved by editing your first post smile

Offline

#11 2015-11-19 03:52:26

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,349

Re: [SOLVED] Unable to update ssh port

klever wrote:

Ah, problem solved. Thanks.

If you were wondering whence went your post, you hit 'report', not 'reply'  hmm


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#12 2015-11-19 04:19:50

klever
Member
Registered: 2015-11-17
Posts: 6

Re: [SOLVED] Unable to update ssh port

ewaller wrote:
klever wrote:

Ah, problem solved. Thanks.

If you were wondering whence went your post, you hit 'report', not 'reply'  hmm

Oh crap haha. Can I take that back?

Offline

#13 2015-11-19 04:29:23

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,349

Re: [SOLVED] Unable to update ssh port

Nope tongue


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#14 2015-11-19 04:40:20

klever
Member
Registered: 2015-11-17
Posts: 6

Re: [SOLVED] Unable to update ssh port

ewaller wrote:

Nope tongue

Haha. Sorry fukawi2 big_smile

Offline

Board footer

Powered by FluxBB