[Snippet] Restrict user to a particular folder

By default in Linux, an SSH can freely navigate around your file system. I recently needed to restrict an SSH user to their home directory. You need rbash.

CentOS doesn’t ship with rbash enabled as default. It was easy enough to solve.

[codesyntax lang=”bash”]
ln -s /bin/bash /bin/rbash

Then change /etc/passwd so that the user’s shell is /bin/rbash.

Alternate ‘Messing with time and date on Linux’

Following up from a previous post, some hypervisors like Xen are a bit fruity when trying to control the time via NTP. Here’s how we managed it.

Firstly, if your installation doesn’t have ntp install. Install that.

[codesyntax lang=”bash”]
yum install ntp

Continue reading “Alternate ‘Messing with time and date on Linux’”

Super simple Active Directory with Samba

I needed a super simple, straight forward way of installing samba on Ubuntu and joining it to an Active Directory domain.
This doesn’t allow you to login to Ubuntu with domain credentials but allows you to share and access files with domain credentials.

Heres how its done Continue reading “Super simple Active Directory with Samba”

[Snippet] Allow mysql root access from anywhere

A small annoyance of mine is on local development servers, I can’t login to the MySQL server as root.

Simply connect the mysql shell

mysq[codesyntax lang=”bash”]
mysql -u


[codesyntax lang=”bash”]

Exit and you’re done.

Ridiculously simple NTLM Authentication for Apache (Ubuntu)

We all know Ubuntu makes things amazingly simple. This is the best I’ve found so far. NTLM authentication in Apache used to take a while to setup, it used to be tricky, fiddly – generally a bit hit and miss. Continue reading “Ridiculously simple NTLM Authentication for Apache (Ubuntu)”