Category: Experiences, How to... — Roger @ 6:24 pm — Comments (3)

Below are the most useful commands (or at least those I found most helpful) when I switched to Ubuntu, to clarify, these commands are not Ubuntu specific, they are Linux commands. I’ve not included some of the basic commands like cd, rm, mv, ls, etc… Play with your terminal, that’s a great way to spend a Friday afternoon! Hee hee hee… (Yes, I’m a geek!) ;) These commands are in no particular order, I just find they are the more helpful (for me and a few of the “converts” near me).

sudo
Execute each command as root, which is safer than actually switching into root via “su”.

ifconfig
Displays the network card connection/configuration.

sudo apt-get install PackageName
Will install the whatever “PackageName” I typed and the dependancy files.

sudo shutdown -h now
Shuts down my Ubuntu and powers it off right away.

&&
Command to complete more that one action. For example:
sudo make && make install
Which runs the “make” script and then installs the “made” package.

ping 10.0.1.1
Sends test packets to whatever IP you type in, to help troubleshoot network connections.

apt-get moo
Just to look smart! ;) Try it!

cat /etc/issue
Displays the current Ubuntu version.

wget http://syserr.com/stuff/madwifi-cvs-20051025.tar.gz
Will download the file from any URL you enter after “wget”

tar -zxfv madwifi-cvs-20051025.tar.gz
Will uncompress the downloaded file

z means “Gunzip(uncompress) it before extracting, used on file ending in .tar.gz or .tgz”
x means “Extract the contents of the TAR file”
f means “Filename to follow”
v means “Verbose - display contents as it is tarring or extracting”

chmod +x install.sh
Command that says “Make the script file install.sh executable”. I sometimes run into this after using wget and trying to run installer scripts.

sudo apt-get autoclean
Removes partial packages.

sudo cp /home/roger/backups/bk03072008.tar.gz /var/www/downloads
Copies a file from one directory to another directory. (in this case the file bk03072008.tar.gz was copied to the /var/www/downloads directory).
If you don’t want to copy but move the file, change cp to mv.

find . -name “*.odt”
When looking for OpenOffice documents (in the current directory and all it’s subdirectories) or find ./roger -name network_notes.odt when I know the exact name of the file.

..
Move up one level in the directory structure.

iwlist scan
Dislay wireless networks that are in range.

mkisofs -V LABEL -r dir | gzip > backups.iso.gz
Makes a CD image of the backup directory contents

cdrecord -v dev=/dev/cdrom blank=fast
Quick command to erase a CDRW

history -c
In a multiuser environment, it is sometimes not good to leave history. Of course you can just “exit” to leave the terminal.

arch
Displays the processor architecture so I know if I should download i386, i686 based application pakages.

whereis something
Displays where “something” is stored.

There are 100’s more. But these are the ones I tend to use more often. As usual, I hope this helps others! :)

And… one for the road…

If you want to create a file called “me”, just “touch me” :)

Category: Applications, How to..., Installation — Roger @ 9:22 am — Comments (2)

Lately, there’s been a bit of discussion here about Ubuntu (and Linux as a whole) security. Suffice it to say, some of the input from readers about Linux virus issues has been very informative. (You can read the post and the comments here: Does Ubuntu Linux Really Need Antivirus Software?). Some of my “Windows Weenies” friends (you know who you are) ;) :) Keep telling me that Ubuntu simply is not as safe as Windows. Personally, I think that is a bunch of horse poo… But, I hope I’m not that smug to think I don’t have to worry at all. :) Well, I don’t. Hee hee hee. Yet, I do appreciate there are things we can do to further enhance our systems.

However, one aspect I think I neglected to expand on (in that antivirus post) are issues relating to kernel and other exploits. Don’t get me wrong, I’m not suggesting that Linux is buggy, rather that sometimes there may be a delay from release to any patches being available. And in my opinion, Linux is far superior in this aspect, when comparing it to my Windows experiences. ;) While I don’t think we all need to rush and download the following free packages, I think it’s important that Ubuntu… actually any Linux user… be aware of some of the great resources we can use to protect our kernels as well as other aspects of our Linux based PC’s. As a matter of opinion, one package in particular is great for a protecting a Linux based PC with multiple users - grsecurity!

grsecurity is “multi-layered detection, prevention, and containment model” that has some great features such as:

Security alerts and audits that contain the IP address of the person causing the alert.
A restriction that allows a user to only view his/her processes.
Prevention of arbitrary code execution, regardless of the technique used.
And quite a few other features…

You can read more about that at the following URL and download a copy to play with: http://www.grsecurity.net/

I am by no means a security expert! But, these are some of the resources I’ve bumped into over time (or has been suggested)

Another, “chkrootkit” is a tool to locally check for signs of rootkits. What’s a rootkit?

“A rootkit is a program (or combination of several programs) designed to take fundamental control (in Unix terms “root” access, in Windows terms “Administrator” access) of a computer system, without authorization by the system’s owners and legitimate managers. Access to the hardware (ie, the reset switch) is rarely required as a rootkit is intended to seize control of the operating system running on the hardware. Typically, rootkits act to obscure their presence on the system through subversion or evasion of standard operating system security mechanisms.” Read the rest of this Wikipedia entry here: http://en.wikipedia.org/wiki/Rootkit

chkrootkit is a series of scripts that aid in protecting your system. You can read more and download copies here: http://www.chkrootkit.org/

I remember when I was still using Windows, I used a firewall named ZoneAlarm, which I thought was pretty good as it did a great job. I thing a comparable firewall system might be Firestarter. I posted about this gem last summer: The Best 10 Minute, Effective Desktop Firewall Installation for Ubuntu Linux

“Firestarter is an Open Source visual firewall program. The software aims to combine ease of use with powerful features, therefore serving both Linux desktop users and system administrators.” The site has downloadable copies and more information here: http://www.fs-security.com/

After some Googling, I was also able to track down some of the “Unsafe” Ubuntu default settings we should look at. Namely:

Shared Memory
“By default, /dev/shm is mounted read/write, with permission to execute programs. In recent years, many security mailing lists have noted many exploits where /dev/shm is used in an attack against a running service.“spacer_gif2 Are You Keeping Your Ubuntu Linux PC Secure?

SSH Default Settings
“While the SSH daemon is secure enough for most people, some may wish to further enhance their security by changing certain sshd settings.”

“su” Program Available to Non-Admin Users
“This is not necessarily a problem alone, but if there are accounts with weak passwords on the system a malicious non-admin user (or malicious software they are using) might use su to gain access to such accounts.”

How do we fix these three issues? Simply visit the source post at Ubuntu and follow along (it’s very easy to do): https://help.ubuntu.com/community/UnsafeDefaults

Finally, the Automatic Security Update post (also on Ubuntu), leaves me a little confused. I thought security updates were already included in Ubuntu’s “automatic updates”? However, here is the step-by-step “tutorial that will teach you to create a script and a cron job to go out and automatically install security updates without requiring you to do anything.“: https://help.ubuntu.com/community/AutomaticSecurityUpdates?highlight=%28security%29

As always, I look forward to any comments you can provide. I hope the above post helps! :)

Category: Experiences — Roger @ 5:15 pm — Comments (0)

One of the readers of another post “Using Ubuntu to Crack WEP“, sent me this video:

Therefore, this is a “quick“, follow-up to that older post.

As I’m sure many of you might appreciate, WEP may probably not be the best solution to securing WiFi. Simply because it’s become mainstream and there are tones of tools (just Google them) that almost automate the process. I’d like to suggest that WPA…2 is one of the most secure. Why? I can’t find any tools that crack WPA2.

Part of the issue (I think) is that not too many devices support it yet. However, if you’re unable to garner WPA2 devices for your Linux (Ubuntu) network, WPA should suffice as a better solution to WEP.spacer_gif2 Dont WEP Me! Ubuntu (and Others) Are Safer With WPA.

For those looking to enable WPA2 in Ubuntu, read here: HOWTO: Wireless Security - WPA1, WPA2, LEAP, etc.
For WPA, there’s a (really) good guide here: Enable WPA Wireless access point in Ubuntu Linux

I’m still using WEP by the way, but will switch to WPA over the weekend.

If anyone knows WPA2 cards devices that work with Ubuntu, please let me know.

Thanks! :)

Category: Experiences — Roger @ 12:49 pm — Comments (1)

The picture below was sent to me earlier today. The original is:
Some rights reserved at Flickr

Funny! :)

bgu Yo Quiero Ubuntu

Category: Applications, How to... — Roger @ 11:41 am — Comments (2)

Continuing on from yesterday’s email adventure: Thunderbird Has Lost my eMail in Ubuntu! a prudent preventive measure (I suggested later in the day) is to make sure you always have a current backup of email! There are a few of ways this can be simply handled:

1) Manually copying (duplicating) the “/.mozilla-thunderbird<The Account Profile Name” directory to another location. Not the most realistic solution, or at least not for me because I’ll never do it on a regular schedule.

2) Using software solutions. For example “Bacula” comes to mind: “…Bacula is a set of computer programs that permit you (or the system administrator) to manage backup, recovery, and verification of computer data across a network of computers of different kinds…”

3) Use a simple cron job to automate the backups. One of the forum contributors (Geoff) at http://forums.suselinuxsupport.de/index.php?s=&showtopic=59642&view=findpost&p=243567 provides a nifty, helpful script here:

#!/bin/sh
## Script to backup Thunderbird email
## Backup needs a date (stamp)
set -x
x=`date +%y%m%d.%H%M`
## Save space by making sure backup is archived
tar zcf thunderb-mail-${x}.tgz ~roger/.thunderbird
## Save the compressed backup to mybackup folder
cp thunderb-mail-${x}.tgz /joe/backups/
## Clean up after, we don't need two copies of the backup
rm ~/thunderb-mail-${x}.tgz

Edit the code in his original post, or the code above to your needs. (In other words, where you see “joe” change that word to your account name). For those not overly familiar with cron job configuration, you can find a synopsis here: CronHowto

To run the cron job in our solution we can do the following:

In your Ubuntu distribution, surf to the /usr/bin/ directory and create a folder called “cron_scripts” (or whatever other name is meaningful to you). Place your new script (let’s call it “tb_email_backup”) in cron_scripts. The full path to the script should be:

/usr/bin/cron_scripts/tb_email_backup

To set up the actual cron (tab) job, enter the following command in a terminal:

crontab -e

vi or nano will open for editing.

The syntax to tell cron when to run that backup script (tb_email_backup) and how often looks like this:

* * * * * command to be executed

The first (from left to right) “*” specifies: Minute
The second “*” specifies: Hour
The third “*” specifies: Day
The fourth “*” specifies: Month
The fifth “*” specifies: Week

In this example, we want the backup to be made at 09:30 hrs every day. The command would be:

30 9 * * * /usr/bin/cron_scripts/tb_email_backup

Note: If you don’t want cron job messages, just place “>>/dev/null 2>&1″ to the end of your command.

For more cron help, there’s another good resource here:  http://www.linuxhelp.net/guides/cron/

Hopefully this will help yesterday’s “issue”, I’m still waiting for him to tell me how it worked out.

Page 3 of 27«12345»...Last »