Comments on: Setting up a secure Ubuntu LAMP server https://blog.al4.co.nz/2011/05/setting-up-a-secure-ubuntu-lamp-server/ My hobby... Mon, 01 May 2017 03:43:24 +0000 hourly 1 https://wordpress.org/?v=6.9 By: Making stephendrake.me – In the Shadow of Trees https://blog.al4.co.nz/2011/05/setting-up-a-secure-ubuntu-lamp-server/#comment-12884 Mon, 01 May 2017 03:43:24 +0000 http://blog.al4.co.nz/?p=872#comment-12884 […] it’s time for the real fun. At this point, I began following this excellent tutorial by Alex Forbes. Many guides will help you set up your VPS, but Alex’s understanding of the […]

]]>
By: Rafael de Paula https://blog.al4.co.nz/2011/05/setting-up-a-secure-ubuntu-lamp-server/#comment-12631 Thu, 06 Oct 2016 00:12:42 +0000 http://blog.al4.co.nz/?p=872#comment-12631 In reply to James.

Thank you! That was very helpful.

]]>
By: Setting up VPS as a web server notes – Nguyen Thuy Vy https://blog.al4.co.nz/2011/05/setting-up-a-secure-ubuntu-lamp-server/#comment-12296 Wed, 29 Jun 2016 02:22:28 +0000 http://blog.al4.co.nz/?p=872#comment-12296 […] Setting up a secure Ubuntu LAMP server has an amazing article. However, it is a little outdated: […]

]]>
By: Alex Forbes https://blog.al4.co.nz/2011/05/setting-up-a-secure-ubuntu-lamp-server/#comment-9626 Wed, 08 Jul 2015 09:16:36 +0000 http://blog.al4.co.nz/?p=872#comment-9626 In reply to Varun.

Hi Varun, thanks for the kind words.

You are correct, to setup another site you would add another file to sites-enabled (or to sites-available and link it to sites-enabled). Web browsers send a “Host:” header, which tells apache which website (dns host) the client is looking for, which it uses to determine which vhost to serve by matching ServerName or ServerAlias.
(the sites-* directories are just a Debian convention for structuring configuration, you could just as easily add another vhost to an existing file)

As you are proxying a site and not running a php or specific apache module, have you considered nginx? Nginx was built for proxying and does it more efficiently than apache does, and is what I’d personally recommend for this purpose.

Cheers!

]]>
By: Varun https://blog.al4.co.nz/2011/05/setting-up-a-secure-ubuntu-lamp-server/#comment-9624 Wed, 08 Jul 2015 04:58:16 +0000 http://blog.al4.co.nz/?p=872#comment-9624 Thanks for the awesome article! I also used some other resources while working with your article to setup apache2 in conjunction with tomcat. I’m trying to host a couple of websites that would be deployed on tomcat and trying to use apache as the smart proxy server in between.

But lets assume a different scenario (and I’m doing this as a good to know for myself and a guide to someone who might later visit this page and browse through comments, which I never normally do until I read all the ones here and they were just a big help!):
So if I was trying to setup two websites, I’m assuming I would need to add another config in the sites enabled folder and have that picked up by the apache2.conf that’s basically doing the overall configuration?

]]>
By: Alex Forbes https://blog.al4.co.nz/2011/05/setting-up-a-secure-ubuntu-lamp-server/#comment-9590 Wed, 01 Jul 2015 09:12:18 +0000 http://blog.al4.co.nz/?p=872#comment-9590 In reply to Saurabh.

Great! Glad to hear you got it sorted.

]]>
By: Saurabh https://blog.al4.co.nz/2011/05/setting-up-a-secure-ubuntu-lamp-server/#comment-9589 Wed, 01 Jul 2015 05:07:25 +0000 http://blog.al4.co.nz/?p=872#comment-9589 In reply to Alex Forbes.

Hi @Alex

Thanks for your detailed response.

Well I tested this: http://olivier.sessink.nl/jailkit/jailkit.8.html

And it works like a charm. Though it took time to figure out the right way, but once found, it was a cake walk!

Interesting though, he too is from NL :)

]]>
By: Alex Forbes https://blog.al4.co.nz/2011/05/setting-up-a-secure-ubuntu-lamp-server/#comment-9581 Tue, 30 Jun 2015 18:49:19 +0000 http://blog.al4.co.nz/?p=872#comment-9581 In reply to Saurabh.

In that case… not really. Simplest way would be to copy in bash and passwd, add an alias called rbash to bash, and set shell to rbash. As the numerous articles will no doubt tell you, you can use ldd to determine the libraries that are required.

Another solution might be to run a separate ssh daemon on a different port, with configuration which would force the shell to passwd, so you can use sftp unimpaired on the default daemon. Not sure of the specific config you’d need, but the man pages should have all the info.

Alternatively you could setup a web daemon which, when sent the correct credentials, would run chage -M in the background. This would mean the user would be prompted to change it on the next login, something that the SFTP protocol supports. That’s getting into dev territory though, and requires authentication and sanitisation of user input for it to be secure. Also, maybe it would simply be easier for this web daemon to update the password itself (although this carries more risk security wise).

]]>
By: Saurabh https://blog.al4.co.nz/2011/05/setting-up-a-secure-ubuntu-lamp-server/#comment-9321 Sun, 07 Jun 2015 05:26:12 +0000 http://blog.al4.co.nz/?p=872#comment-9321 In reply to Alex Forbes.

Thanks @Alex for your response!

Clarification: The user is allowed to login through SFTP and jailed in the designated directory. Additionally the user should also be able to login through SSH and change his password. These two settings are required simultaneously!

]]>
By: Alex Forbes https://blog.al4.co.nz/2011/05/setting-up-a-secure-ubuntu-lamp-server/#comment-9318 Sat, 06 Jun 2015 20:45:59 +0000 http://blog.al4.co.nz/?p=872#comment-9318 In reply to Saurabh.

You’re right, this is somewhat beyond the scope of this article! :)

If you want the user to only be able to change their password, I would set their login shell to /usr/bin/passwd – this is much simpler than setting up a chroot.

]]>