Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot login into Ubuntu via SSH 1

Status
Not open for further replies.

ComputersUnlimited

IS-IT--Management
Dec 18, 2013
37
0
6
US
I changed the port number of ssh in the sshd_config file and was able to login via the new port number. I rebooted the server and now I cannot log in with the new port number. I can only login if I change the port back to 22.

I had fail2ban, denyhosts and UFW installed prior to changing the port. I have stopped fail2ban, denyhosts and UFW but still cannot login.

Any assistance is appreciated.
 
Did you open the new port through the firewall or in iptables before rebooting?


Other than that "Need more input" as "cannot log in" is somewhat vague./

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.
 
I have stopped the UFW firewall and still get the same result

Login was probably the wrong choice of wording. Before rebooting I was able to access the system just fine, after rebooting I get an error that says "Network error: the connection timed out". When I try to make the connection the black Window opens with the green cursor a few seconds later the error is displayed. If I change the port back to 22 I can connect with no problem.


ssh_error_mpi8un.jpg
 
If I change the port back to 22 I can connect with no problem.

Then the most probable cause is that the port is not open in iptables, I don't use UFW to manage iptables but I would hazard a guess that stopping UFW does NOT stop iptables as well, as UFW is just a management GUI for iptables, not the firewall itself.

Try executing this;
Code:
sudo iptables -A INPUT -p tcp --dport [nnnn] -j ACCEPT

replacing [nnnn] with the port you set for sshd, then see if you can login/access the server.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.
 
For some reason the new rule wouldn't enter into the iptables, but you did help point me in the right direction.

I had the purpose of iptables backward, I thought it was to tel the firewall what to allow and what to block.

Thanks for the help, I am familiar linux but only a newb to it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top