Ubuntu root access.

2007/06/20 13:51:58

One of the greatest features that Linux has to offer, is the ability to customize your version so that it works the way you like it. Being a computer science student I have many friends that run linux, and many running windows (most dual boot).

With some of my windows friends there is a bit of an on going war about who’s computer is better, IBM vs Dell, Windows vs Linux vs Mac, Ubuntu vs Fedora Firefox vs IE, Vista vs XP. The things to debate are endless, its mostly all in good fun but it can sometimes get heated. The great thing is that usually when someone finds a “flaw” with ubuntu I can fix it on the spot if I so chose. Common arguments are that the brown is ugly (I love the brow), all I need do is fire up beryl or compiz (gl desktop). And the argument is shutdown.

The other day it was pointed out to me that a “flaw” was that if ubuntu was booted into recovery mode that the user was then given root access without the need of a password. I know that /boot/grub/menu.lst controls grub so I open it up “sudo gedit /boot/grub/menu.lst” and search for the word “password” at line 28 I find

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command ‘lock’
# e.g. password topsecret
# password –md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecrete

I change it to

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command ‘lock’
# e.g. password topsecret
# password –md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
password topsecrete

Go down to the bottom of the file and change

## ## End Default Options ##

title Ubuntu, kernel 2.6.20-16-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=8fdab1e2-1453-4eb3-a8db-a14dbff447d0 ro quiet splash
initrd /boot/initrd.img-2.6.20-16-generic
quiet
savedefault

title Ubuntu, kernel 2.6.20-16-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=8fdab1e2-1453-4eb3-a8db-a14dbff447d0 ro single
initrd /boot/initrd.img-2.6.20-16-generic

title Ubuntu, kernel 2.6.20-15-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.20-15-generic root=UUID=8fdab1e2-1453-4eb3-a8db-a14dbff447d0 ro quiet splash
initrd /boot/initrd.img-2.6.20-15-generic
quiet
savedefault

title Ubuntu, kernel 2.6.20-15-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.20-15-generic root=UUID=8fdab1e2-1453-4eb3-a8db-a14dbff447d0 ro single
initrd /boot/initrd.img-2.6.20-15-generic

title Ubuntu, memtest86+
root (hd0,0)
kernel /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

to

## ## End Default Options ##

title Ubuntu, kernel 2.6.20-16-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=8fdab1e2-1453-4eb3-a8db-a14dbff447d0 ro quiet splash
initrd /boot/initrd.img-2.6.20-16-generic
quiet
savedefault

title Ubuntu, kernel 2.6.20-16-generic (recovery mode)
lock
root (hd0,0)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=8fdab1e2-1453-4eb3-a8db-a14dbff447d0 ro single
initrd /boot/initrd.img-2.6.20-16-generic

title Ubuntu, kernel 2.6.20-15-generic
lock
root (hd0,0)
kernel /boot/vmlinuz-2.6.20-15-generic root=UUID=8fdab1e2-1453-4eb3-a8db-a14dbff447d0 ro quiet splash
initrd /boot/initrd.img-2.6.20-15-generic
quiet
savedefault

title Ubuntu, kernel 2.6.20-15-generic (recovery mode)
lock
root (hd0,0)
kernel /boot/vmlinuz-2.6.20-15-generic root=UUID=8fdab1e2-1453-4eb3-a8db-a14dbff447d0 ro single
initrd /boot/initrd.img-2.6.20-15-generic

title Ubuntu, memtest86+
lock
root (hd0,0)
kernel /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

Now not only can the user not access anything but my default boot option with using the very secure password, lol. While I don’t consider it a bug that the user could have gained access to the root before without a password I love how easy it is in Linux to prevent that kind of thing. Now all I need is to set my BIOS password so that the user cant boot of anything but the hard disk without a password.


My top 10 commands

2007/06/12 15:34:46

I thought it was nifty when Jorge Bernal did a My top 10 commands, so here are mine. Funny thing was that Jorge Bernal command did not work for me so I added on a few extra commands to make it work for me.

history | awk ‘{print $2}’ | awk ‘BEGIN {FS=”|”} {print $1}’|sort|uniq -c | sort -n | tail | sort -nr

Note: wordpress seems to be messing up the single and double quotes, you need to remove them and retype them in

Rank Times Searched Command Comment
10 5 ssh Remote login to my other computers.
9 9 geany Best IDE I have found.
8 9 history If I want to look at recent commands I have used.
7 12 xpdf Good pdf viewer.
6 15 python One of my favorite programing languages.
5 38 svn Subversion, great revision control for all my projects.
4 41 ./a1q3.py An assignment I was working on.
3 59 gnome-open Will open any file just as nautilus would have if you had double clicked the file.
2 127 cd Change directory.
1 150 ls List directory.

What are your top 10 commands?


Democracy 0.9.6 is out, but is it worth the upgrade?

2007/06/06 18:29:06

I wrote about Democracy a month ago, back then the biggest comment that I got was that Democracy wouldent work for them. Democracy just released version 0.9.6 today and in the release post they claimed to have fixed support for feisty. Now I have been running the stock version that comes in the Ubuntu repository’s and I must say it is a product that once you use it you will never go back. I love coming home and having all of my vlogs downloaded for me ready to watch, I just wish I could find more Ubuntu vlogs, if anyone can find some let please post a link in the comments. I’m quite adventurous when it comes to Ubuntu and I will install anything weather or not I think it will break my system. So I backed up my ~/.democracy folder added the democracy repository, they have a great tutorial by the way, to my sources.list and upgraded.

First thing that happens when you run democracy is that it will “upgrade” the storage system for all your subscribed vlogs, this is why I backed up my democracy folder, and then it seg faults.

earobinson@NaN:~$ democracyplayer
/usr/bin/democracyplayer:87: DeprecationWarning: The dbus_bindings module is deprecated and will go away soon.

dbus-python 0.80 provides only a partial emulation of the old
dbus_bindings, which was never meant to be public API.

Most uses of dbus_bindings are applications catching the exception
dbus.dbus_bindings.DBusException. You should use dbus.DBusException
instead (this is compatible with all dbus-python versions since 0.40.2).

If you need additional public API, please contact the maintainers via
.

import dbus_bindings
/var/lib/python-support/python2.5/dbus_bindings.py:5: DeprecationWarning: The dbus_bindings module is deprecated and will go away soon.

dbus-python 0.80 provides only a partial emulation of the old
dbus_bindings, which was never meant to be public API.

Most uses of dbus_bindings are applications catching the exception
dbus.dbus_bindings.DBusException. You should use dbus.DBusException
instead (this is compatible with all dbus-python versions since 0.40.2).

If you need additional public API, please contact the maintainers via
.

from dbus.dbus_bindings import *
INFO Starting up Democracy Player
INFO Version: 0.9.6
INFO Revision: unknown
INFO Loading preferences…
INFO Starting event loop thread
INFO Restoring database…
INFO Connecting to /home/earobinson/.democracy/sqlitedb
TIMING Database load slow: 0.463
INFO Recomputing filters…
INFO Spawning auto downloader…
INFO Displaying main frame…
WARNING Menu item action “CheckVersion” not implemented
WARNING Menu item action “FastForward” not implemented
WARNING Menu item action “Rewind” not implemented
WARNING Menu item action “UpVolume” not implemented
WARNING Menu item action “DownVolume” not implemented
WARNING Volume changed before videoDisplay created
WARNING Display updated before video display was created
INFO Creating video display…
INFO *** Launching Downloader Daemon ****
alsa
oss
pulseaudio
file
none
INFO loaded renderer ‘xinerenderer’
INFO Setting VolumeLevel to 1.0
TIMING gtkAsyncMethod: took too long: 1.483
Segmentation fault (core dumped)

This was what I had expected from a product that had gone since the 2 months without upgrading to support feisty. I posted in the comments about what happened hoping to warn users that this may break the version of democracy that they have installed.

What I did not expect was about an hour and a half later there is a response in the comments from Nicholas Reville, who i can only assume is a democracy employ, that says that they are working on it. Another two and a half hours later Ben (another democracy employ?) posts to say they have fixed the problem. The great part of this is that they had. All in all it took them about 4 hours to fix the problem and upload it to the democracy repository.

This makes me ask the question, is it worth the upgrade. The ubuntu MOTU, do a great job of ensuring that every package that makes it into the Ubuntu repository is a working and quality package. Not only did democracy leave the feisty version of democracy broken for months but they don’t seem to test that much before they release a new version, however they did release a fix quickly. The version of democracy in the Ubuntu repository was working for me (thanks to the ubuntu MOTU), but I love the bleeding edge.

I for one will upgrade to the new version of democracy, but I will do so knowing that in the future things may break and that I will keep a backup of both the install deb files and my ~/.democracy folder just in case things break again and they don’t provide an upgrade for another 2 months. What are you going to do?


Finite State Machine

2007/06/05 15:01:44

Part of my goal with this blog is to write about the Ubuntu experience, I’m still working on a wireless writeup but it keeps getting pushed back because everyone knows about Ubuntu wireless. I’m a student at the University of Toronto, and I’m currently taking CSC363 — Computability and Complexity. Anyways I’m doing my first assignment and the first question is to draw a finite state machine. My problem was that I would draw the finite state machine and the figure out that I missed some special case and have to re draw it. Getting frustrated I fired up synaptic and searched for (finite stat machine), synaptic returns four results but the one that catches my eye is graphviz, partly because it has the ubuntu logo beside it meaning its an officially supported package like gaim (anyone find a link to support this, I cant), and partly because of its decryption “rich set of graph drawing tools”. I install it and it all goes well, and then i do what I always do after I install a program, I run it.

I type “graphviz” into the terminal and nothing happens. Well thats weird usualy I can just run programs based off the names I installed them with. I go back to synaptic and check that its installed correctly which it is. So skip to the bottom of the description below and it turns out that graphviz website, all the time that I’m doing this my buddy is sitting beside me trying to find a windows program to draw finite state machines.

Heading over to the website it turns out that they have some great examples of finite state machines and the “source code” that was used to make them. It is at about this time that my buddy finds JFLAP and starts to download it, you have to fill out a bunch of information before you can. A bit more searching on that website and I learn that I can “compile” that source code code to a png image with the following command “ccomps -x fsm.dot | dot | gvpack | neato -s -n2 -Tpng > fsm.png”

Now as a side note the nifty thing is that JFLAP (the program my buddy found) is a jar file so we should be able to run it on linux, while I continued to use graphviz to do my assignment because I liked to type up the finite state machine and then compile it, if you want to test your finite state machine you may want to look into using JFLAP.

After I get my assignment back Ill post my finite state machine and its source if there is interest.


Follow

Get every new post delivered to your Inbox.