Search this site:

2008-09-27

sudo and /etc/sudoers...


I have just done something very stupid...

I was connecting to a Mac OS X box in my office remotely and I tried to grant rights to certain users to run the sudo command. Here is what I did:

  1. sudo vi /etc/sudoers
  2. edit the file
  3. :wq (i.e. save and quite in vi)

Experienced users should be able to point out my stupid mistake here. Yes, I should never edit the sudoers file directly using an non-root user... Reason? It is really simple - what if I accidentally screw up the file?
$ sudo vi /etc/sudoers
>>> sudoers file: syntax error, line 23 <<<
sudo: parse error in /private/etc/sudoers near line 23


Just like this.

...

Yes. I have no way to fix the problem until I can get back to the office next Monday and boot the box into single-user mode.

Hurray! No more work this weekend!

...

Anyway, remember to use the visudo command to change the file, it can help to check the syntax before finalizing changes... Or at least I should su to root before editing this file, so that I don't need sudo to fix the sudo problem...

Note: this is not only applicable to Mac OS X but also other *-nix system too.

2008-09-29 Updated: I finally got back to office and boot the Mac into single-user mode. However, I need one more trick to update the files as the root filesystem is mounted at read-only by default. Here is the trick:
# mount -uw /

2008-09-03

Google Chrome First Glance




Google has just released their new browser named Google Chrome today. Just tried it out. It seems to be notable faster for Google Maps, Google Documents and Picasa Web Ablum. Credits should goes to the new JS engine, and maybe also the individual process for each browser tab.

According to the official announcement:

We owe a great debt to many open source projects, and we're committed to continuing on their path. We've used components from Apple's WebKit and Mozilla's Firefox, among others -- and in that spirit, we are making all of our code open source as well. We hope to collaborate with the entire community to help drive the web forward.

Hurray. As expected, Google Chrome and Firefox are relatives. But sadly enough the Blogger WYSIWYG editor seems to be buggy in Google Chrome. My first unverified guess is that Apple's WebKit added codes to the box and mess things up... Stay claim, the browser is just in beta anyway.

See whether I have time to go more in-depth into the issue and try out other features of this new member of the web browser family.

Disclaimer

ALL CONTENTS AND INFORMATION IN THIS WEB SITE ARE PROVIDED "AS IT" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. THE ACCURACY AND AVAILABILITY OF THE CONTENTS, INFORMATION AND THE WEB SITE ITSELF ARE NOT GUARANTEED. THE AUTHOR TAKES NO RESPONSIBILITIES ON ANY COSTS OR DAMAGES (DIRECT OR INDIRECT) ARISING OUT OF OR IN CONNECTION WITH THE ACCESS, USAGE OR INABILITY OF USAGE OF THIS WEB SITE.