On my new server, I created a personal login account for me to use. I normally never use user 'admin'.... however:
Yesterday, I ftp'ed from an old server into one of my new rackshack dual xeon servers. I did ftp just ONCE, to transfer a database from the older server. I used the admin login, just for the hell of it....
This morning I find in the logs that _THREE_ people have since signed into my server via ftp. Two american hosts, and one from switzerland.
Luckly for me:
- sshd is running on a different port than normal, so they couldn't ssh into the box.
- I'm running portsentry, which proceeded to blackhole everyone who then tried to ssh in, completely blocking access to the machine.
- User account 'admin' has no access to my files, and is not in the same Group as webserver.
- I only have 2 user accounts (including 'admin'), and root, and all three have different passwords that are not dictionary crackable.
- Passwords on all my servers are different.
I've since checked the 3 user accounts for anything in lastlog, run chkrootkit, and nothing seems to be out of the ordinary.
It looks like the crackers tried the ftp login to verify the admin pass worked, then tried to access the machine via ssh (standard port) and got blocked. They then tried to port scan from a diff host, and also got immediately blackholed by portsentry.
I highly recommend the following:
1) Do not use FTP. use scp instead (http://winscp.vse.cz/eng/download.php) which basically works the same as ftp does, but without giving out your password to everyone, AND you do not need to run ftpd anymore.
2) If you have more than one IP address, have sshd bind to just one of them (logically, use the least popular IP so that your main site doesn't even show ssh ports anywhere)
3) Install portsentry (make sure your own ip address is added in the .ignore file just in case you trigger it to block
4) Move ssh's default port to a random high level port.
5) use secure passwords (duh)
6) Don't use the same password for all your accounts, especially root (duh again)
7) If possible, set gcc and all other compilers to be root-accessable only.
9) If you're giving a friend your login info, remember that Instant Messages are also in plaintext.
I hope this post helps someone out there.