Posts tagged port
Sshd_config Settings Rundown
Feb 3rd

- Image via Wikipedia
First change the port you are using. Do not use port 22 on servers that have internet connectivity. This is the first port that will be checked by countless robots searching the internet for vulnerabilities. Change the port to whatever, and then use the -p option in your ssh login attemt. Then make sure root login is disabled, remove the pound symbol from the front of the option line. If you can you should definitely allow rsa key login. Once you get your encryption key setup disable password login by setting the respective line to “no”. If you cannot enable keyed logins for any reason what soever, you should enabled ip based restrictions either by iptables or by tcp wrappers. Iptables is configured with the iptables command, and the tcp wrappers are configured in /etc/hosts.allow. You can reduce the time limit for password login, but sometimes this causes problems with remote users connecting; sometimes it takes a couple of extra seconds for people to login. Make the time limit around 30 seconds. If people are still having trouble connecting check the /var/log/auth.log file for more information about the failed login attempt. Maybe the password is too complicated? Before reducing the complexity of the password implement fail2ban, which will automatically block ip addresses based on failed login attempts, therefore you can reduce the complexity of the password without substantially reducing system security.
Sendmail – Yes, You Can Send Your Own Email
Nov 29th

I’ve gone over sendmail several times, but ultimately it comes down to a couple of factors. Unless you are setting up an enterprise level email server, and require some login settings, and potential relaying, sendmail is relatively simple. You start by installing it:
sudo apt-get install sendmail
Sendmail operates on port 25 because it is an SMTP server. It will receive email and place it in /var/mail, and depending on how you setup virtual users, possibly with a virtusertable, the mail will go into a subfolder. With a virtusertable you map incoming addresses to particular users on the system, and you can use a catch all email address.
Enable the virtusertable as per this previous post:
http://www.bgevolution.com/blog/debian-sendmail-virtusertable/
Here is more info about how to configure the virtusertable:
http://www.bgevolution.com/blog/sendmail-consolidate-multiple-domains/
Go ahead and add some security by binding sendmail locally. This will allow your local email client to send and receive email locally. For the local machine itself set 127.0.0.1. My email server is in a virtual machine, therefore the host accesses the server by a local ip address. I also have to set sendmail to listen on the local ip address of the virtual machine.
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA-local')dnl
DAEMON_OPTIONS(`Port=smtp,Addr=192.168.1.150, Name=MTA-network')dnl
Now if you have a php mailer script in your website it will have access to sendmail for email distribution purposes. Also your thunderbird will be able to connect to send mail. Now, even if you enable port forward sendmail should not respond. Any mail distribution requests originating from your external ip address, even if its forwarded to the local ip of the server, should not be responded to. You would have to create a daemon options line to access mail from the the external ip address.
There are other interesting things to deal with in sendmail. This is how you would integrate spamassassin into sendmail directly on the server. You can also integrate ClamAV, which I should get around to blogging about it soon. There are some tricky things to integrate ClamAV, on the server level, in Debian; but ultimately it relatively straight forward as compared to spamassassin.
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=e60bad9b-01fa-477c-8d93-931cacb700d4)