Showing posts with label ssh. Show all posts
Showing posts with label ssh. Show all posts

Thursday, April 16, 2015

Disabling root ssh is very good Idea

Found a few good sites with too much information: They all boil down to giving SUDO access to one of your other accounts and disabling ssh access for the root account. Your can still login as root through your datacenters provisioned KVM since it emulates a local keyboard and video display. In case you ever get locked out or your IP banned for some reason.

As a failsafe, you might consider putting the public IP of a trusted source in the
/etc/hosts.allow file in case you get locked out accidentally. That why you know that all you need to do is go to that place to restore access to your account. It could be your office's public IP, or campus university public IP, or just another server you have control over.

Once you have SUDO access on another account:
Just edit /etc/ssh/sshd_config and make sure this line PermitRootLogin no , reads as so.

Sunday, July 21, 2013

Pre-Login SSH banner

I was feeling very nostalgic one day and wanted an Ascii Art Login screen like the old BBSes I used to frequent as a youngster.

As you probably already know, I'm using Debian Squeeze, but this should work in just about any linux distro.

Just put what you want to appear in /etc/ssh/sshd_banner:

This is a private system! All attempts are logged!

Then, open /etc/ssh/sshd_config and modify this line:

#Banner /etc/issue.net
Banner /etc/ssh/sshd_banner


You can find cool ASCII art generators and galleries on-line.

Friday, July 19, 2013

How to fix SSH timeouts

This is such a nuisance. I don't know of anything more annoying than to walk away to the bathroom, kitchen or whatever; and come back to find your terminal session disconnected.

This can also be helpful when running jobs that take a little longer, but I would really advise using SCREEN for that.

We will tackle this problem from both ends, the server and the client.


On the server

Edit /etc/ssh/sshd_config and add the line:


ClientAliveInterval 60

On the client

Edit /etc/ssh/ssh_config and add the line:

ServerAliveInterval 60