Changing listening ports with openSSH

Multi tool use
i recently decided to turn my old desktop pc into a linux server where i can host my files etc. I followed a tutorial which used openssh and after installing it and configuring some files it works like a charm. I have a few questions though: the tutorial i followed here uses nc -v -z [addr] [port] to check if the ssh service is working on that port. However, no matter which port i use in the sshd_config file, it won't successfully listen on that port. Any ideas why?
PS: i'm a complete beginner to linux :)
*Running on Ubuntu 18.04LTS
networking server ssh
add a comment |
i recently decided to turn my old desktop pc into a linux server where i can host my files etc. I followed a tutorial which used openssh and after installing it and configuring some files it works like a charm. I have a few questions though: the tutorial i followed here uses nc -v -z [addr] [port] to check if the ssh service is working on that port. However, no matter which port i use in the sshd_config file, it won't successfully listen on that port. Any ideas why?
PS: i'm a complete beginner to linux :)
*Running on Ubuntu 18.04LTS
networking server ssh
Are you running thenc
command with the loopback address127.0.0.1
as shown in the guide you linked? from where are you running the command?
– steeldriver
Feb 21 at 1:31
@steeldriver no,I'm using the local one and I'm running it from /home
– Stelios Papamichail
Feb 21 at 1:42
add a comment |
i recently decided to turn my old desktop pc into a linux server where i can host my files etc. I followed a tutorial which used openssh and after installing it and configuring some files it works like a charm. I have a few questions though: the tutorial i followed here uses nc -v -z [addr] [port] to check if the ssh service is working on that port. However, no matter which port i use in the sshd_config file, it won't successfully listen on that port. Any ideas why?
PS: i'm a complete beginner to linux :)
*Running on Ubuntu 18.04LTS
networking server ssh
i recently decided to turn my old desktop pc into a linux server where i can host my files etc. I followed a tutorial which used openssh and after installing it and configuring some files it works like a charm. I have a few questions though: the tutorial i followed here uses nc -v -z [addr] [port] to check if the ssh service is working on that port. However, no matter which port i use in the sshd_config file, it won't successfully listen on that port. Any ideas why?
PS: i'm a complete beginner to linux :)
*Running on Ubuntu 18.04LTS
networking server ssh
networking server ssh
asked Feb 21 at 1:18


Stelios PapamichailStelios Papamichail
1134
1134
Are you running thenc
command with the loopback address127.0.0.1
as shown in the guide you linked? from where are you running the command?
– steeldriver
Feb 21 at 1:31
@steeldriver no,I'm using the local one and I'm running it from /home
– Stelios Papamichail
Feb 21 at 1:42
add a comment |
Are you running thenc
command with the loopback address127.0.0.1
as shown in the guide you linked? from where are you running the command?
– steeldriver
Feb 21 at 1:31
@steeldriver no,I'm using the local one and I'm running it from /home
– Stelios Papamichail
Feb 21 at 1:42
Are you running the
nc
command with the loopback address 127.0.0.1
as shown in the guide you linked? from where are you running the command?– steeldriver
Feb 21 at 1:31
Are you running the
nc
command with the loopback address 127.0.0.1
as shown in the guide you linked? from where are you running the command?– steeldriver
Feb 21 at 1:31
@steeldriver no,I'm using the local one and I'm running it from /home
– Stelios Papamichail
Feb 21 at 1:42
@steeldriver no,I'm using the local one and I'm running it from /home
– Stelios Papamichail
Feb 21 at 1:42
add a comment |
1 Answer
1
active
oldest
votes
sshd
, the ssh
server, reads its config file (/etc/ssh/sshd_config
) on sshd
startup.
sudo service sshd restart
is one way to make this happen.
No, it will not. It will cause it to no longer accept new sessions on the old port, but existing sessions will be allowed to proceed.
– Wouter Verhelst
Feb 21 at 9:01
So should i try this or is it "dangerous"?
– Stelios Papamichail
Feb 22 at 12:54
You should try it. What makes you think it's "dangerous"? You can see which portsshd
is listening to bysudo lsof -c sshd -a -i
– waltinator
Feb 22 at 14:54
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1119981%2fchanging-listening-ports-with-openssh%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
sshd
, the ssh
server, reads its config file (/etc/ssh/sshd_config
) on sshd
startup.
sudo service sshd restart
is one way to make this happen.
No, it will not. It will cause it to no longer accept new sessions on the old port, but existing sessions will be allowed to proceed.
– Wouter Verhelst
Feb 21 at 9:01
So should i try this or is it "dangerous"?
– Stelios Papamichail
Feb 22 at 12:54
You should try it. What makes you think it's "dangerous"? You can see which portsshd
is listening to bysudo lsof -c sshd -a -i
– waltinator
Feb 22 at 14:54
add a comment |
sshd
, the ssh
server, reads its config file (/etc/ssh/sshd_config
) on sshd
startup.
sudo service sshd restart
is one way to make this happen.
No, it will not. It will cause it to no longer accept new sessions on the old port, but existing sessions will be allowed to proceed.
– Wouter Verhelst
Feb 21 at 9:01
So should i try this or is it "dangerous"?
– Stelios Papamichail
Feb 22 at 12:54
You should try it. What makes you think it's "dangerous"? You can see which portsshd
is listening to bysudo lsof -c sshd -a -i
– waltinator
Feb 22 at 14:54
add a comment |
sshd
, the ssh
server, reads its config file (/etc/ssh/sshd_config
) on sshd
startup.
sudo service sshd restart
is one way to make this happen.
sshd
, the ssh
server, reads its config file (/etc/ssh/sshd_config
) on sshd
startup.
sudo service sshd restart
is one way to make this happen.
edited Feb 22 at 14:52
answered Feb 21 at 1:49
waltinatorwaltinator
22.9k74169
22.9k74169
No, it will not. It will cause it to no longer accept new sessions on the old port, but existing sessions will be allowed to proceed.
– Wouter Verhelst
Feb 21 at 9:01
So should i try this or is it "dangerous"?
– Stelios Papamichail
Feb 22 at 12:54
You should try it. What makes you think it's "dangerous"? You can see which portsshd
is listening to bysudo lsof -c sshd -a -i
– waltinator
Feb 22 at 14:54
add a comment |
No, it will not. It will cause it to no longer accept new sessions on the old port, but existing sessions will be allowed to proceed.
– Wouter Verhelst
Feb 21 at 9:01
So should i try this or is it "dangerous"?
– Stelios Papamichail
Feb 22 at 12:54
You should try it. What makes you think it's "dangerous"? You can see which portsshd
is listening to bysudo lsof -c sshd -a -i
– waltinator
Feb 22 at 14:54
No, it will not. It will cause it to no longer accept new sessions on the old port, but existing sessions will be allowed to proceed.
– Wouter Verhelst
Feb 21 at 9:01
No, it will not. It will cause it to no longer accept new sessions on the old port, but existing sessions will be allowed to proceed.
– Wouter Verhelst
Feb 21 at 9:01
So should i try this or is it "dangerous"?
– Stelios Papamichail
Feb 22 at 12:54
So should i try this or is it "dangerous"?
– Stelios Papamichail
Feb 22 at 12:54
You should try it. What makes you think it's "dangerous"? You can see which port
sshd
is listening to by sudo lsof -c sshd -a -i
– waltinator
Feb 22 at 14:54
You should try it. What makes you think it's "dangerous"? You can see which port
sshd
is listening to by sudo lsof -c sshd -a -i
– waltinator
Feb 22 at 14:54
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1119981%2fchanging-listening-ports-with-openssh%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
T8yB1HZMo7Geu IFdUldbauq,z,HD,P0NZwY5i,ytyliJwX xkY ffAPkM0VAjbH vTwZrdVrDvNk20 e,hg
Are you running the
nc
command with the loopback address127.0.0.1
as shown in the guide you linked? from where are you running the command?– steeldriver
Feb 21 at 1:31
@steeldriver no,I'm using the local one and I'm running it from /home
– Stelios Papamichail
Feb 21 at 1:42