dsgnr wrote:Ok, everything is working correctly however, I have a few questions.
1. What should really be done to secure the Pi a little more now it's publicly available? Are there any firewalls, brute-force protectors? Should I disable SSH for users except root and Pi I can only imagine what someone who shouldn't get in can do so I'd like to lock it down as much as I can. Should I rename the Pi username? Anyone have any pointers?
The best protection is to use the least possible ammount of services and in this set-up you've got a lot of unnecessary services enabled.
Since you are making backups from a publicly availably webserver you don't need to expose your Pi at all since it can connect to the server anyways using ssh. To create automatic backups you can use rsync or scp from a cron script on your Pi.
Securing ssh is done by denying root logins and password authentication so users can only log in using public key authentication. Most attacks that target ssh try to bruteforce passwords for common user names like: root, mysql, oracle, guest, test, etc.. To completely avoid these attacks you can change the ssh port (below 1024 for else it it vulnerable to other attacks) but this is not always practical.
The first thing you should do after installing Raspbian is to change the root password, add a new user and remove the default user.
2. I have successfully created a new user (called dan for examples sake) and a new directory (called FTP). I have chroot set to Yes in my vsftpd.conf file but the user can still access the / files as they please, although it does not let them change files I believe. Is there a way to completely lock the user 'dan' to the 'ftp' folder? I'd rather not let users apart from myself have access to the / files. Or does it not really matter if they don't have permissions to edit?
I've used vsftpd a couple of times and always had this same problem. not being able to write to / doesn't stop someone that really wants to do something bad. Being able to read config files can be just as dangerous since those contain passwords, api keys and whatever else you have configured. there is a chrooted vsftp deamon package out there that should work but I'd recommend you use a jailed ssh setup or
DropBear.
For setting up secure servers there is only one person I know of that knows it all:
Falko Timme, the main author for
HowToForge.com.
I suggets you install some virtual machine app like VirtualBox, VMware player or KVM and build 2 or 3 of his "perfect Server" HOWTO's to get familar with Linux servers and security hardning.
I'm brand brand new to this stuff. My only other venture with a Pi is XBMC. Being a web dev, I can get to grips with the languages pretty easily, it's just knowing all the variables I struggle with!
The most important thing to learn about Linux is where to find the right documentation, most of it is right under your nose and can be accessed by executing:
Manual page command (man)
or execute a program or config file with the -h or --help parameter
Code: Select all
[i]program-name[/i] -h
[i]program-name[/i] --help
And all other system documentation can be found under the directory
/usr/share/doc and more can be installed using apt-get.
If this docu does not provide you with an answer try popular wiki's and sites like HowToForge.com, TLDP.org, Gentoo wiki, ArchLinux Wiki. And then you can move on to the forums and IRC channels since those are mostly helpfull when you know what's wrong but don't have a fix.
Thanks in advnace.
Sorry for all the questions. I have been browsing around for ages but have not found anything that works yet!
Dan
Never be sorry for asking questions for you might stop asking them.
And btw.. not exactly what you were looking for but it might give you some fresh ideas:
Howto: Raspi disk sharing over LAN using autofs