Connecting to amazon lightsail ubuntu server using different ssh port
I have changed ssh port in lightsail server in /etc/ssh/sshd_config
file to 2200, I have enabled firewall to accept connections on port 2200. But when I am trying to connect through my local machine using command,
ssh -i key.pem ubuntu@13.xxx.x.109 -p 2200
It is showing me an error "ssh: connect to host 13.xxx.x.109 port 2200: Connection refused". Can you help me out why it's connection is being refused?
ssh
add a comment |
I have changed ssh port in lightsail server in /etc/ssh/sshd_config
file to 2200, I have enabled firewall to accept connections on port 2200. But when I am trying to connect through my local machine using command,
ssh -i key.pem ubuntu@13.xxx.x.109 -p 2200
It is showing me an error "ssh: connect to host 13.xxx.x.109 port 2200: Connection refused". Can you help me out why it's connection is being refused?
ssh
Has the key already been shared to the lightsail server, could you use it to login successfully on the default port? Also, do you need to use the absolute path to the key file?
– Arronical
Mar 28 '18 at 9:51
yeah i was able to connect to lightsail server through port 22 using private key but when I changed port settings and enabled firewall settings on lightsail server its showing me the error shown above. Currently I am using ubuntu as local machine.
– Bhanu Sankhyan
Mar 28 '18 at 12:07
1
Did you change the port that the ssh server is listening on and restart the ssh server? This is normally done in the/etc/ssh/sshd_config
file on the server you're trying to ssh into.
– Arronical
Mar 28 '18 at 12:24
1
yes I did changed the port to 2200 and i also checked with nmap, its showing "host is up" on 2200 port of lightsail ubntu server,that means 2200 port is open on server but it's not listening on port 2200 when i am connecting through ssh using my local machine.
– Bhanu Sankhyan
Mar 28 '18 at 12:38
add a comment |
I have changed ssh port in lightsail server in /etc/ssh/sshd_config
file to 2200, I have enabled firewall to accept connections on port 2200. But when I am trying to connect through my local machine using command,
ssh -i key.pem ubuntu@13.xxx.x.109 -p 2200
It is showing me an error "ssh: connect to host 13.xxx.x.109 port 2200: Connection refused". Can you help me out why it's connection is being refused?
ssh
I have changed ssh port in lightsail server in /etc/ssh/sshd_config
file to 2200, I have enabled firewall to accept connections on port 2200. But when I am trying to connect through my local machine using command,
ssh -i key.pem ubuntu@13.xxx.x.109 -p 2200
It is showing me an error "ssh: connect to host 13.xxx.x.109 port 2200: Connection refused". Can you help me out why it's connection is being refused?
ssh
ssh
edited Mar 28 '18 at 9:47
Arronical
13.5k84892
13.5k84892
asked Mar 28 '18 at 8:51
Bhanu SankhyanBhanu Sankhyan
61
61
Has the key already been shared to the lightsail server, could you use it to login successfully on the default port? Also, do you need to use the absolute path to the key file?
– Arronical
Mar 28 '18 at 9:51
yeah i was able to connect to lightsail server through port 22 using private key but when I changed port settings and enabled firewall settings on lightsail server its showing me the error shown above. Currently I am using ubuntu as local machine.
– Bhanu Sankhyan
Mar 28 '18 at 12:07
1
Did you change the port that the ssh server is listening on and restart the ssh server? This is normally done in the/etc/ssh/sshd_config
file on the server you're trying to ssh into.
– Arronical
Mar 28 '18 at 12:24
1
yes I did changed the port to 2200 and i also checked with nmap, its showing "host is up" on 2200 port of lightsail ubntu server,that means 2200 port is open on server but it's not listening on port 2200 when i am connecting through ssh using my local machine.
– Bhanu Sankhyan
Mar 28 '18 at 12:38
add a comment |
Has the key already been shared to the lightsail server, could you use it to login successfully on the default port? Also, do you need to use the absolute path to the key file?
– Arronical
Mar 28 '18 at 9:51
yeah i was able to connect to lightsail server through port 22 using private key but when I changed port settings and enabled firewall settings on lightsail server its showing me the error shown above. Currently I am using ubuntu as local machine.
– Bhanu Sankhyan
Mar 28 '18 at 12:07
1
Did you change the port that the ssh server is listening on and restart the ssh server? This is normally done in the/etc/ssh/sshd_config
file on the server you're trying to ssh into.
– Arronical
Mar 28 '18 at 12:24
1
yes I did changed the port to 2200 and i also checked with nmap, its showing "host is up" on 2200 port of lightsail ubntu server,that means 2200 port is open on server but it's not listening on port 2200 when i am connecting through ssh using my local machine.
– Bhanu Sankhyan
Mar 28 '18 at 12:38
Has the key already been shared to the lightsail server, could you use it to login successfully on the default port? Also, do you need to use the absolute path to the key file?
– Arronical
Mar 28 '18 at 9:51
Has the key already been shared to the lightsail server, could you use it to login successfully on the default port? Also, do you need to use the absolute path to the key file?
– Arronical
Mar 28 '18 at 9:51
yeah i was able to connect to lightsail server through port 22 using private key but when I changed port settings and enabled firewall settings on lightsail server its showing me the error shown above. Currently I am using ubuntu as local machine.
– Bhanu Sankhyan
Mar 28 '18 at 12:07
yeah i was able to connect to lightsail server through port 22 using private key but when I changed port settings and enabled firewall settings on lightsail server its showing me the error shown above. Currently I am using ubuntu as local machine.
– Bhanu Sankhyan
Mar 28 '18 at 12:07
1
1
Did you change the port that the ssh server is listening on and restart the ssh server? This is normally done in the
/etc/ssh/sshd_config
file on the server you're trying to ssh into.– Arronical
Mar 28 '18 at 12:24
Did you change the port that the ssh server is listening on and restart the ssh server? This is normally done in the
/etc/ssh/sshd_config
file on the server you're trying to ssh into.– Arronical
Mar 28 '18 at 12:24
1
1
yes I did changed the port to 2200 and i also checked with nmap, its showing "host is up" on 2200 port of lightsail ubntu server,that means 2200 port is open on server but it's not listening on port 2200 when i am connecting through ssh using my local machine.
– Bhanu Sankhyan
Mar 28 '18 at 12:38
yes I did changed the port to 2200 and i also checked with nmap, its showing "host is up" on 2200 port of lightsail ubntu server,that means 2200 port is open on server but it's not listening on port 2200 when i am connecting through ssh using my local machine.
– Bhanu Sankhyan
Mar 28 '18 at 12:38
add a comment |
2 Answers
2
active
oldest
votes
You need to turn on the port of the lightsail manage console.
Use Custom not SSH
Then change the ssh port to 2200
add a comment |
I am using aws LightSail and I ended up doing the following:
add to lightsail management console:
Application = Custom,
Protocol = TCP,
Port = 2200edit the port in sshd_config in /etc/ssh/ folder to 2200.
restart sshd by
sudo service restart sshd
add the rule to firewall
sudo ufw allow 2200/tcp
enable the firewall
sudo ufw enable
Hope this helps!
New contributor
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%2f1019891%2fconnecting-to-amazon-lightsail-ubuntu-server-using-different-ssh-port%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You need to turn on the port of the lightsail manage console.
Use Custom not SSH
Then change the ssh port to 2200
add a comment |
You need to turn on the port of the lightsail manage console.
Use Custom not SSH
Then change the ssh port to 2200
add a comment |
You need to turn on the port of the lightsail manage console.
Use Custom not SSH
Then change the ssh port to 2200
You need to turn on the port of the lightsail manage console.
Use Custom not SSH
Then change the ssh port to 2200
answered Apr 20 '18 at 17:18
Luis TorruellaLuis Torruella
112
112
add a comment |
add a comment |
I am using aws LightSail and I ended up doing the following:
add to lightsail management console:
Application = Custom,
Protocol = TCP,
Port = 2200edit the port in sshd_config in /etc/ssh/ folder to 2200.
restart sshd by
sudo service restart sshd
add the rule to firewall
sudo ufw allow 2200/tcp
enable the firewall
sudo ufw enable
Hope this helps!
New contributor
add a comment |
I am using aws LightSail and I ended up doing the following:
add to lightsail management console:
Application = Custom,
Protocol = TCP,
Port = 2200edit the port in sshd_config in /etc/ssh/ folder to 2200.
restart sshd by
sudo service restart sshd
add the rule to firewall
sudo ufw allow 2200/tcp
enable the firewall
sudo ufw enable
Hope this helps!
New contributor
add a comment |
I am using aws LightSail and I ended up doing the following:
add to lightsail management console:
Application = Custom,
Protocol = TCP,
Port = 2200edit the port in sshd_config in /etc/ssh/ folder to 2200.
restart sshd by
sudo service restart sshd
add the rule to firewall
sudo ufw allow 2200/tcp
enable the firewall
sudo ufw enable
Hope this helps!
New contributor
I am using aws LightSail and I ended up doing the following:
add to lightsail management console:
Application = Custom,
Protocol = TCP,
Port = 2200edit the port in sshd_config in /etc/ssh/ folder to 2200.
restart sshd by
sudo service restart sshd
add the rule to firewall
sudo ufw allow 2200/tcp
enable the firewall
sudo ufw enable
Hope this helps!
New contributor
New contributor
answered 1 hour ago
CharIntCharInt
1
1
New contributor
New contributor
add a comment |
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%2f1019891%2fconnecting-to-amazon-lightsail-ubuntu-server-using-different-ssh-port%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
Has the key already been shared to the lightsail server, could you use it to login successfully on the default port? Also, do you need to use the absolute path to the key file?
– Arronical
Mar 28 '18 at 9:51
yeah i was able to connect to lightsail server through port 22 using private key but when I changed port settings and enabled firewall settings on lightsail server its showing me the error shown above. Currently I am using ubuntu as local machine.
– Bhanu Sankhyan
Mar 28 '18 at 12:07
1
Did you change the port that the ssh server is listening on and restart the ssh server? This is normally done in the
/etc/ssh/sshd_config
file on the server you're trying to ssh into.– Arronical
Mar 28 '18 at 12:24
1
yes I did changed the port to 2200 and i also checked with nmap, its showing "host is up" on 2200 port of lightsail ubntu server,that means 2200 port is open on server but it's not listening on port 2200 when i am connecting through ssh using my local machine.
– Bhanu Sankhyan
Mar 28 '18 at 12:38