Question

Console Login Works, SSH Login Doesn't

When I click console, I am prompted for a login. I use “root” and then enter my password. That works fine.

I use putty to SSH in, I am prompted for a login. I use “root” and then enter my password (as prompted), but it doesn’t accept the login credentials.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

Hi @usedearplugs

Have you modified security settings for SSH or root at some point?

Login on console, then run tail -f /var/log/auth.log. Now login over SSH and have it fail. What do you see in the console? Also have a look with tail -50 /var/log/syslog

You can take screenshots of the console and upload to imgur.com and post link here.

@usedearplugs

If you’re able to log in to console, but not via SSH, ufw is probably active and you’ve been blocked.

If you log in to console, run ufw status and see if ufw is running. If it is, you can disable using:

ufw disable

Once disabled, try to login via SSH. If you’re able to login once again, I’d simply reset ufw and add your policies back.

ufw reset
ufw default deny incoming
ufw default allow outgoing

Allow SSH:

ufw allow 22/tcp

If you need HTTP/HTTPS (Ports 80 and 443):

ufw allow 80/tcp
ufw allow 443/tcp

Once you’ve setup your firewall rules as above, re-enable ufw:

ufw enable

I am having the similar problem. I am not able to login via ssh via Putty. When ever i try to login i get connection timed out. But from console its working. Please help me!

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.