Well it's Saturday

Ah. Good morning everyone....or rather, anyone who may be reading this ;) Seeing as how I Just started this, I highly doubt that a large number of individuals are actually reading it, but you are, so that's a start :). As I am writing this amount of information, I try and think of something to say. It is hard for me to sit down an hour before and decide on a topic. So I just kinda randomly get this started, and think of different things to do in the mean time. So I suppose I will go ahead, and try and figure something out. Anyway, back to the purpose of this blog. Linux. So you know what linux is I am sure, if you have read anything in this blog, then you should know something about linux ;). Why do the people that do use linux use it? Why do the people that don't, not use it? That is a very good question. As for me, the reasons why I chose to use linux goes pretty far and wide. I have decided to completely endorse the open source movement. Why? Because it is a good idea. I love the fact that I can go and grab any piece of software for my linux desktop, and not have to worry about doing something illegal. I love the fact that I don't have to worry about losing my hard drive over a virus or something that I really shouldn't be worrying about. I love the fact that I can open up my computer and say...Yeah. I designed that. Yeah. I made that myself. Yeah. I really put in a lot of work on that, and man it was worth the the effort. I love feeling, like I am a part of my computer. I mean yeah a lot of users with different operating systems put in a lot of work into their projects, but what about the OS? What did they do to that? Change the theme? Pft. What did THEY put into the OS? In most cases, it isn't a whole lot. But with linux, you can put in what you want! You can take out what you don't need, configure what you have, to suit every need that you could possibly have at all! I mean how awesome is that? To be able to say that you can honestly put something into your operating system? I did. You can. Anyone can. I use linux, because not only is it faster, it is more secure, it gives me a wider horizon of options, for example, when I open up my computer, and the kernel loads, I just know, that I have options, I mean, everything I do, I have the option with. I can choose what loads, I don't have to worry about having a problem, and WAITING for MS to fix it ;). I can fix it myself. I have the source code for almost everything, unlike Microsoft, where everything they do is copyrighted, and they can't even let their users make the product better! Why do some people not use linux? It really depends on the person honestly, and obviously. I know people that work with windows everyday, and they do, genuinely love computing, and love learning, but they just simply don't have time. The time they DO have on the computers when they get home from work, is 15 minutes, no where near enough time to make some room for learning a new operating system. Then there are the people, that just don't care. ;). Which are the people, that I argue with. I can really understand if you do not honestly have the time. But that so far, is the only excuse I can find, that is true. I don't even want to hear people that say they can't learn something new, or that they are not intelligent enough to learn a new operating system, like linux, God designed us with room to move our intelligence. We are in no way at all static, we can all learn something new. Anyway, enough with my rant. I have a pretty interesting little piece here coming up, any feedback from anyone on if I am doing anything right, or wrong, or what I could do would be great!

Encrypting your Swap.

So maybe we should define the swap first ;).
Your swap space is like your RAM, only it is space designed on your hard drive. I'm sure that for some of you, the first time you set up your linux box, and was in the install, and it prompted for you to partition your swap space out....you stared blankly at your screen, and then went to that spare computer to hit wikipedia ;). Anyway, for those of you that don't know how it works, it goes like this: When you are working with your computer, and your RAM gets filled up, all used, there is the lonely swap, that finally gets it's chance to shine. It "swaps" *;)* out the information in the RAM into your swap space. So then you have some free RAM! Some of you, even experienced users, may wonder why you would want to encrypt your swap. Well, think about this, you are running 20 applications, music, firefox, IM client, etc. All while you are at the hotel, in your bed, enjoying that free WIFI service, watching that incredibly small television, that doesn't seem to work right ;). Anyway, this WIFI hotspot, obviously has more users, and there happens to be a malicious user, experienced with linux. Anyway, you remember that you changed your password for your mom to get on while you went away a week ago so she could check her email. So you decide to change your password, but your RAM is filled up. Where does that information log and go? Your swap naturally! But this hacker, has a way into your system, some vulnerability, anyway, has access ;). He can get into your swap with the right tools, and check all that info out, and take it. So then he has your password, but if your swap was encrypted, that was one less problem you have. So now that you have seen a practical use for it, lets get to it!

I use ubuntu, (Debian) so I have apt-get. I would recommend becoming root for all this to make it easier, but I have just always used sudo :P

Install cryptsetup:

sudo apt-get install cryptsetup

Lets go ahead and pretend your swap is /dev/hda4.

Create the encryption:

sudo cryptsetup create swap /dev/hda4

Type a strong password, not your root password, or your yahoo password ;).

Use your favourite text editor for this, mine is nano.

sudo nano /etc/crypttab

And add this line:

swap /dev/hda4 /dev/random swap

On the next reboot your swap will be encrypted! But if you are antsy, and want it encrytped NOW this will work:

sudo cryptsetup remove swap

sudo /etc/init.d/cryptdisks start

sudo swapon -a

And there ya go. Your swap is now encrypted!


I guess you should see now, I am a big terminal guy ;). I love me some terminal. In fact, 90% of my work is terminal based ;). So now that I am thinking about this, how about a lesson in terminal usage? Some basic commands maybe, for the newbs, and a reference for the experienced? Well, I think it is a good idea dadgummit, so here we go :p

Useful CLI Commands
---------------------------
execute a program
./ (This doesn't work for EVERY program just so you know :P)

change directory
cd (Obviously this is pretty self evident)

go to home dir
cd
(This just changes to your /home/username Directory)

change permissions
chmod (Most of the time this is used with the parameters to make it executable)

change ownership
chown (Also pretty self evident)

create a new user
adduser (Ok from here on, the obvious commands I will just skip)

change password
passwd

make an ssh connection
ssh -l
(If you use SSH of course, and if you do you should pretty much know how to do this)

use text browser
lynx
(If you have lynx installed naturally)

switch users
su -u


remote root login
su -u root (after regular connection is made)

create multiple screens
screen (This has been talked about in the LinuxReality podcast, and there is so much to it, but just install it, and play with it)

check connections
netstat

access a cd
mount /mnt/cdrom (Providing that your cdrom is in /mnt/cdrom of course)

eject a cd
umount /mnt/cdrom eject (woot)

access irc channel
irc (assuming it is in a directory that is included in your env path)

access your ipchains or iptables
./ipchains or ipchains (may have to be in directory depending on env path)

check your location
pwd

send network message
talk


find a file
find / -name
-print (wildcards * can be used)

make a new directory
mkdir

remove a directory
rmdir

list all files in a directory
ls

display file content
cat filename

copy files
cp file /home/ryan/directory/

move files
mv file /home/ryan/where_I_want_my_file/

search for a keyword
grep. used something along the lines of cat /etc/X11/xorg.conf | grep ati

create a new text doc
sudo nano nameofyourfile

stop a process
sudo kill processid
-----------------------------------


Well, I need to get ready to go to services, so that should do for now, maybe I will have something better by tonight.


Axl.



0 comments:

Post a Comment