INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Cannot login into Ubuntu via SSH

Cannot login into Ubuntu via SSH

(OP)
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.

RE: Cannot login into Ubuntu via SSH

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.

RE: Cannot login into Ubuntu via SSH

(OP)
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.


RE: Cannot login into Ubuntu via SSH

Quote:

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 --> shell

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.

RE: Cannot login into Ubuntu via SSH

(OP)
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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close