It is completely unnecessary to give someone a shell on your server. A shell should only be given out to administrators of that server (and others that perform maintanance on it).
Therefore, in this guide, using OpenSSHd, I will show you what you need to add to your sshd_config file to make the magic happen.
First off, you need to understand that you can designate what kind of shell a user has by using the “usermod -s /bin/lolcakes user1?
This is a continuation of the “Setting up a RAID Array with mdadm”
In this article, I will show you how to add two more drives (in my case, two more 1.5TB drives) and expand the array to use the new space.
So I’ve got my two new drives, /dev/sdf and /dev/sdg
1: Use fdisk to partition them with one single partition using the “Linux Raid Autodetect” option. Make sure to use “w” to write the options to the drive.
I’ve been using Google Docs for a few months and I love it. I can access everything from everywhere. No worrying about something being on a box that I can’t get to for some unknown reason.
Whats even better is that Google has released GoogleCL, a command line utility for linux that lets you interact with many of google’s services, especially google docs.
So I figured, I’m a paranoid kid who would do RAID 1+1 if he had the money.
I mount a few shares using sshfs and I like to make sure they are synced with my local raid 1 array for backup. So how can I run rsync making sure the share is mounted already?
What I do below is, using the mount command, check to see if the sshfs share is mounted to /mnt/login and if it is, it syncs with a directory on my local machine and puts the date into a file so I know when the last sync was run.
Got a bunch of public directories you need to set permissions on? Here ya go…
#!/bin/bash<br></br> #set the owner and group for these directories recursively<br></br> chown -R bill:noobs /pub/this<br></br> chown -R bill:noobs /pub/that<br></br> chown -R bill:noobs /pub/theotherthing<br></br> #set perms for all sub-directories<br></br> find /pub/this -type d | xargs -d"\n" chmod 755<br></br> find /pub/that -type d | xargs -d"\n" chmod 755<br></br> find /pub/theotherthing -type d | xargs -d"\n" chmod 755<br></br> #set perms for all files<br></br> find /pub/this -type f | xargs -d"\n" chmod 644<br></br> find /pub/that -type f | xargs -d"\n" chmod 644<br></br> find /pub/theotherthing -type f | xargs -d"\n" chmod 644
Lets say you had a web page and you wanted to change the css at certain times to show a new picture. Here’s some sed regexp’s to do it for ya.
In this example, I am picking a random image from a directory of approved images and switching out the old whatever.jpg with newstuff.jpg
______________________backchange.sh
#!/bin/bash<br></br> #heres the line i am going to be editing (actually the background of my site):<br></br> #background-image: url(https://website.
So I created this little guy to help me out. Whenever run, he generates a date line in html that looks like this on a web page:
Last updated Wednesday December 15 2010
and updates a footer file I’ve called foot.tpl
_________update.sh
#!/bin/bash<br></br> #change the Last updated part of foot.tpl<br></br> cd /var/www/<br></br> #generate nice looking date command<br></br> DATE="$(date "+%A %B %e %Y")"<br></br> MYVAR="<p>Last updated"<br></br> END="</p>"<br></br> FINAL="$(echo $MYVAR $DATE $END)"<br></br> #we are going to look for any line that has the word updated and replace that whole line with our new one now contained in the variable FINAL<br></br> sed "<br></br> /updated/ c\<br></br> $FINAL<br></br> " foot.
So I run this minecraft server. And the users that play on it are always creating and developing new things constantly a.k.a. Michigan Tech University out of blocks!!
So there was a big need to backup the map directory quite a bit. Right now its only about 50MB’s or so but I know it will get bigger as more and more elements are added. So we decided that everyday backups should be sufficient.
mdadm is a command line software raid tool for raid’ing multiple partitions/disks together without worrying about any hardware devices or drivers.
With mdadm, you can do any type of raid you like as well as monitor and recover from drive losses etc..
Its pretty much the ultimate tool for anything raid on linux!
In my situation, I wanted to create a sweet media server for high definition movies and media without having to spend a fortune on hardware raid devices.
I have established this site for the wealth of system administrators out there that love to explore, create, and discover new types of things they can do to their systems.
The purpose of this site is to provide everyone with some of the scripts, guides, and commands I have used in my journey through system administration throughout the past several years.
Every guide or script posted on this site has been tested by me on the Debian distribution (64-bit) and should work for you given you follow the instructions, have a pretty decent understanding of the Linux operating system (+ command line) and are willing to learn.