Posts Tagged ‘linux’

Locking Down SSH with hosts.allow

Posted in Computers on August 19th, 2010 by hurt – Be the first to comment

After installing my new file server I started to notice the large amount of ssh attempts to log into the box. For a very long time I have been using hosts.allow to tighten things up a little. Figured a good place to keep this info and help others might be to make a blog post of how I use this.

edit /etc/hosts.allow

sshd : localhost : allow
sshd : 192.168.2. : allow
sshd : 192.168.3. : allow
sshd : 199.12.12.12 : allow
sshd : ALL : deny

Enter the above info in your hosts.allow file. You can add as many IP address as you want to be allowed. End this all with the last line to deny everything else that is not listed above it. I would suggest setting this up at a time you have physical access to the box. This might not work for everyone since some people might just around from place to place and have random locations. I tend to just be logging in from home and work. Although I have not used it you could also use a range of ips. If you are always on a certain ip range but not the same ip you could do this.

sshd : 199.12 : allow
sshd : ALL : deny

Enjoy and don’t lock yourself out of your own box. ;)


Clean Install of Ubuntu 9.10

Posted in Computers, Screenshots on February 10th, 2010 by hurt – Be the first to comment
Clean Install of Ubuntu 9.10

Clean Install of Ubuntu 9.10

Dual Location MPD File Stores

Posted in Computers on January 11th, 2010 by hurt – Be the first to comment

I run a mpd server on my laptop as I like the gmpc music client. I use my laptop both at work and home. When I am at home I have my laptop on the dock most of the time and my music is located on my file server under a directory /storage/music/. This is normally mounted to /mnt/storage/music. When I am at work I have a little media system that holds all my music in the folder /media/music. Up till today I was using to separate gmpc profiles and having to switch them manual. This created havoc if the mount point was not mounted when mpd started up.

Since both music directories on the servers contain the same music with the same file layout, I decided to write a quick little script to correct this and make playing music at home and work as simple as possible.

First I wanted to run my script on boot up of the system.

This use to be done with a bootmisc file located in /etc/… Not sure why this is gone in this day and age but I found a nice little howto and will break it down short for you.

as root:

touch /etc/init.d/bootmisc.sh

chmod +x /etc/init.d/bootmisc.sh

update-rc.d bootmisc.sh start 20 2 .

The above few lines will create a file called bootmisc.sh in /etc/init.d/ that you can put some handy bash commands in to run on startup. Good for more than just setting up mpd how you want auto magically.

Next we need to make our script to load mpd depending on our location


ifconfig | grep '172.16.10.'

if [ "$?" = "0" ]; then
mount 192.168.0.2:/storage/music /home/richard/Music
/etc/init.d/mpd restart
/etc/init.d/mpdscribble restart
fi

ifconfig | grep '192.168.0.'

if [ "$?" = "0" ]; then
mount 192.168.0.2:/storage/music /home/richard/Music
/etc/init.d/mpd restart
/etc/init.d/mpdscribble restart
fi

Paste the above in your bootmisc.sh file we created and setup mpd to load the music from the default ubuntu ~/Music folder on your system.

To explain the above a little I will just say that it will check for you ip address, and depending on which ip address you have issue the mount command for the server it needs. Anyone that knows basic Bash should be able to figure out how to change this to what they need, but if you stumble across this and really need it to work and have no clue what needs to be done just leave a comment and I will try to explain this a little more.

I am loving the boot up and play my tunes from a remote server with no mounting or restarting of mpd! :)

Arrakis Friday Night Screenshot

Posted in Computers, Screenshots on October 9th, 2009 by hurt – Be the first to comment

Quick job creating a background while listen to some nirvana.

arrakis_screenshot-10092009

arrakis_screenshot-10092009

You can get the wallpaper below.

kurt_cobain-1440x900

kurt_cobain-1440x900

Another Screenshot From Work

Posted in Computers, Screenshots on September 22nd, 2009 by hurt – 1 Comment
Arrakis Screenshot Sept 22, 2009

Arrakis Screenshot Sept 22, 2009