Jump to content
Sign in to follow this  
Bruno

Tips for Linux Explorers

Recommended Posts

Bruno, I love this thread. We should talk about other ways to make it available. I could put it on the website, publish your installments as a regular section in the newsletter, we could create a sub-forum for it right here in the All Things Linux forum. Or any combination. Anything that interests you. I just love this idea! B) -- Scot

Share this post


Link to post
Share on other sites

Scot,Any idea that suits you ! It's your forum, I can only write these things on your vehicle ! Your ideas about the newsletter would not only be fine, but a real honor !As subforum . . . just as long as it is obvious and easy to find for the users of the "All Things Linux" forum, it is for helping them that I am writing these "tips". To warm them up, make them easy with the commandline, to make them eager to learn more and understanding their OS. That is my primary goal, my friends here on the forum who only recently made the jump.We will talk about the actual shape of it, give me some time to think.B) BrunoPS: if you do put them in your newsletter, please edit the text to *real* English.

Share this post


Link to post
Share on other sites

CONFIGURING YOUR NETWORK CARD

 

NOTE: I scrambled a few things together out of a thread from Stryder and his troubles of configuring his NIC.

Bits and pieces were taken from posts of Peacy and Lilbambi

 

First we will install the driver, in this example a Tulip driver.

 

Go to the directory of the driver:

$ su
< password >
# cd /lib/modules/'uname -r'/kernel/drivers/net/tulip

 

Then we will install the driver:

# install -m 644 tulip.o

 

load the driver:

# /sbin/insmod tulip.o
# depmod -a

 

# cd

( come back to the home directory )

 

# netconfig

( to configure your networkcard )

 

# ifconfig eth0 up

( will put your connection up )

( ifconfig eth0 down to kill it )

 

If all went well:

# netstat -i

( Will show you the "eth0" and "lo" )

 

Now try to ping a welknown host like your ISP

# ping www.cnn.com

 

You should be able to see traffic there and your connection is O.K.

 

If not, a reboot, after editing your modules.conf ( see next part ) sometimes helps.

 

Now new still have to edit your modules.conf for the modules to be loaded at boot:

$ su
< password >
# emacs /etc/modules.conf

 

NOTE: There will already be a few lines in modules.conf, do not change those ! Only add the line:

alias eth0 tulip

 

and safe the file with

< Ctrl+x >

< Ctrl+c >

and

< y >

 

That's all there is to it folks.

 

First webpage to visit is: http://forums.scotsn...r.com/index.php?

 

B) Bruno

Share this post


Link to post
Share on other sites

PENGUIN LIBREATION FRONT UPDATE!

 

For those of you loving the PLF rpm's just like I do, there is a cheat-code to avoid those messages at install, you know the ones saying that the package misses the official Mandrake signature:

 

Mandrake 9.1

Open a console

$ su < password >

 

and paste the following line after the prompt:

 l.inks -source http://plf.zarb.org/plf.asc | gpg --import

 

Mandrake 9.2

wget http://plf.zarb.org/plf.asc; rpm --import plf.asc; rm -f plf.asc

 

WARNING: you have to be on-line for the trick to work!

 

I'm still searching after the texstar cheat-codes, had them for the 9.0 but the site moved and the new one does not provide the necessary info anymore.

 

B) Bruno

Share this post


Link to post
Share on other sites

KNOPPIX CHEAT-CODES

 

Sometimes your Knoppix live CD can give a little problem, sure with Nvidia and Radeon cards.

Here are a few cheatcodes you can try:

 

Normaly at the prompt at boot:

knoppix lang=en screen=800x600

 

Cheatcodes:

Knoppix lang=en nopcmcia

Knoppix lang=en nopcmcia noapm

Knoppix lang=en noapm

 

Nvidiacard !!!! :

knoppix lang=en xmodule=nv|radeon|savage|s3

 

knoppix lang=en xserver=XFree|XF86_SVGA

 

You can always press F2 at the prompt for more options: language, mouse, etc.!

 

B) Bruno

 

* There is a full list of cheatcodes and other official Knoppix information added next in The Tips

Share this post


Link to post
Share on other sites
:P When I first tried to join a local Linux User Group I was told to "read all the books and howtos and don't ask stupid questions and waste everybody's time". Needless to say I took their advice but didn't join their group.Joy
Yeah, that is how it was for me on 2 or 3 different forums in the past. It not only made one think linux users were jerks, it completely destroyed my interest in the OS. Bruno has changed all of that though. It is reassuring knowing you have somewhere to turn for help.

Share this post


Link to post
Share on other sites

You're so kind Stryder, but like I did say before; it are ALL the friends here on the forum, who make it such a fine place to hang out !B) Bruno

Share this post


Link to post
Share on other sites
it is ALL the friends here on the forum, who make it such a fine place to hang out !
that is the best tip of all Bruno here is what I managed to do with you suggestions on partitoning ( Mandrale 9.1) On the HD on the desk top I have 8.3 GB of linux space . I nthe partioning part there is an aotomatic setup , 50 % / 50 % /home and a 500 Mg swap file , worked fine except I have an interesting error message in boot up "Finding Moduel Dependances" , message "idm_validate_Partition_Table () .....Disk read failed in stead of OK but the system works . Took about 3 boot ups to get all the message :blink: Laptop the automatic feature didn't work so I have a size modified setup based on the 10 GB partition . works perfectly , no error message. ( /, /var ,/home and swap)The tip on the PLF should help getting Xine to read DVD.,s with the D4D, D5Dlib plugins next will be to network the Linux in both machines and that other OS windozNow hopefullly this will make the post list :huh: charlie aka the gray hair generation

Share this post


Link to post
Share on other sites

Hi CharlieGlad this is all working so well for you !Did I get this right: you have 2 systems, a normal box and a laptop. The laptop is 100% O.K., but if you've got problems with the other one; feel free to post a new thread, so everybody can learn from it as we try to fix it ! :blink: Bruno

Share this post


Link to post
Share on other sites

REDIRECTIONS

( AND THE BLACK HOLE: >/dev/null )

 

Right, it's about time to put something right: uptill now I did use the "<" and ">" characters to make clear to you what part of the text the real commands were. For "The Linux Starters" that seemed like a good idea.

 

Now we come to the point where I do need those signs to have a function in the commands I will tell you about.

But let's be fair, if you made it up till here, you can't be considered as a "Starter" anymore. And you will know a command when you see one !! ;)

 

We use the "> <" signs for redirections, example:

$ ls /music/dylan/*.mp3 1>songs.txt

 

Will make a list ( ls ) of all the files in the dylan directory ( /music/dylan ) ending with .mp3 ( *.mp3 ) . This list usualy sent to standard out ( 1 ) but now redirected ( > ) to the file songs.txt ( songs.txt ) in your /home.

 

NOTE: the 1 for standard out is in this example not really needed, but we might as well get used to it ! 0=Standard in ( usually the keyboard ) 1=Standard out ( the normal output on your screen ) 2=Standard error ( the error messages you get on the screen )

 

Still with me ? Next example:

$ wc -l 0<songs.txt

 

Will count the lines ( wc-l ) from the input ( 0< ) of the file songs.txt

Simply said: it will tel you how many Bob Dylan .mp3's there are in my dylan directory ! Well, that is a nifty trick isn't it ?

 

O.K. Because you're starting to like this, one last example:

$ ls -R /var >/dev/null 2>errors.txt

 

This is a funny one, let me first explain what we end up with, before cutting it in pieces: we will get a list of all the files we have no permission for, in the /var directory ( the error messages we usually see on the screen as we try to access a file we have no permissions for ).

List all the files in all directories ( ls -R ) in the /var directory ( /var ) and send them ( > ) to the black hole ( /dev/null ) and send all the error messages ( 2> ) to a file called errors.txt ( errors.txt )That's it for today friends, glad I managed to get it noted down ! :lol:( *wipes the sweat of his forehead )

 

B) Bruno

Share this post


Link to post
Share on other sites

Hi Everyone,(If you want to read my tip skip the first paragraph)Bruno, I really appreciate the information you have posted! Linux and I have an off and on again relationship but with people like you helping out I hope to build a lasting and working knowledge of Linux. A friend recommended Scot's newsletter and it has been a vast resource of knowledge of Windows and now Linux too. Thanx Scot!Here is my tip:If you have ever wondered about the status of your network connection ie. if Full-Duplex is in effect. I ran across a simple program that shows you statistics about your interface.If you go to Linux Ethercard Status, Diagnostic and Setup Utilities website, you can download the mii-diag.c source code. Once you download the source, go to the directory that you downloaded it to and type <gcc mii-diag>, assuming that you have gcc installed. If not, the Mandrake Control Center --> Software Management --> Search for gcc will install it. Assuming again, that you have a rpm source setup correctly. Once you compile the source code, a binary will be created. When you run the program with <./mii-diag> you will get the promised statistics. Note: There are compile switches that can change the way mii-daig works. More information can be found in the documentation on the website or in the source code itself.Have Fun!

Share this post


Link to post
Share on other sites

Welcome to the forum mrselfdestruct and thank you for those kind words. The fact that you, next to these praises are including a tip in your very first post is a very good start ! I really hope we can restore your "off and on" relationship with Linux. Looking forwards to your admissions. If at any time you think we're overlooking one of your posts ( weird things do happen sometimes ) feel free to send us a PM.:P Bruno

Share this post


Link to post
Share on other sites

MD5SUM of an ALREADY BURNED CD

( Also see: Check CD Script )

 

A few posts back I told you to do the md5sum on the ISO files themselves, just because that is far off the easy way ! ;)

However CD's can be checked too, it only takes a little more.

First check if you have "isoinfo" installed on your Linux box.

Type in a console:

$ whereis isoinfo

 

If it's not installed, look for it on your install-CD's !

 

Here is how it is done ( my example here is a Slackware 9.0 CD )

Put the CD in your CD-rom player, and type in a console:

$ isoinfo -d -i /dev/cdrom

 

This will give you something like this:

CD-ROM is in ISO 9660 format

System id: LINUX

Volume id: Slack9d1

Volume set id:

Publisher id: Slackware Linux, Inc. <info@slackware.com>

Data preparer id: Slackware Linux, Inc. <info@slackware.com>

Application id: Slackware Linux 9.0 disc 1

Copyright File id:

Abstract File id:

Bibliographic File id:

Volume set size is: 1

Volume set sequence number is: 1

Logical block size is: 2048

Volume size is: 339344

Joliet with UCS level 3 found

Rock Ridge signatures version 1 found

 

The only important info of this output are these two lines:

Logical block size is: 2048

Volume size is: 339344

 

Now, leave the CD in the player and type:

$ dd if=/dev/cdrom bs=2048 count=339344 conv=notrunc,noerror | md5sum

 

BEWARE: change the numbers with the ones you found in the previous output !!

 

This will produce a new output ( takes several minutes ! )

339344+0 records in

339344+0 records out

563c1bfff307a16d45f5da04011f07b6 <===( This is the checksum number ! )

 

Now go to the mirror you have downloaded your ISO from ( or any other mirror ) and pick up the text-file md5sum. This textfile contains the original number:

563c1bfff307a16d45f5da04011f07b6 slackware-9.0-install.iso

 

If this number matches the number you found in the output above, you can be sure your CD is integer !

 

In this case it was, but then I always check the numbers before burning my CD, 'cause that's so much easier and does not turn any blank CD's into coasters ! :D :D

 

UPDATE: Recently added to the tips: Check CD Script

 

B) Bruno

Share this post


Link to post
Share on other sites

WOW! This is quite a book of knowledge Bruno. B) Although I have only breifly read this post, I have already learned much. I had several Linux questions but I see several are answer. Keep up the good work!Borst

Share this post


Link to post
Share on other sites

Thank you Borst, and welcome to the forum.Hope you will find a "home" here !B) Bruno

Share this post


Link to post
Share on other sites

CONFIG COMMANDS in REDHAT ( and FEDORA )

 

 

If you want to shutdown the services via the console (xterm) or terminal, then login as root....Type in 'ntsysv' You will then get a list of the services. Press F1 for more info. To disable use the space-bar. And finally OK. Reboot and note the changes.....

 

Via GUI, RedHat has a tool too; ''redhat-config-services"

 

Btw, the other system-admin tools for RedHat are:

redhat-config-date

redhat-config-httpd

redhat-config-keyboard

redhat-config-kickstart

redhat-config-language

redhat-config-mouse

redhat-config-network

redhat-config-network-cmd

redhat-config-network-druid

redhat-config-network-gui

redhat-config-network-tui

redhat-config-nfs

redhat-config-packages

redhat-config-printer

redhat-config-rootpassword

redhat-config-samba

redhat-config-securitylevel

redhat-config-services

redhat-config-soundcard

redhat-config-services

redhat-config-timeredhat-config-users

redhat-config-xfree86

redhat-control-network

redhat-install-packages

redhat-logviewer

redhat-update-gnome-font-install

redhat-update-gnome-font-install2

 

Many thanks to our special agent !

 

B) Bruno

 

PS: Fedora has most of that commands too . . but they start with "system-config-", here they are:

system-config-date

system-config-display

system-config-keyboard

system-config-language

system-config-lvm

system-config-network

system-config-network-cmd

system-config-printer

system-config-rootpassword

system-config-samba

system-config-securitylevel

system-config-services

system-config-soundcard

system-config-time

system-config-users

system-control-network

system-install-packages

**** need to give name of package to install

Share this post


Link to post
Share on other sites

EXTRA MOUSE BUTTONS

 

A lot of you people have a mouse with all those fancy extra buttons: three, four or even seven buttons are common place these days. Makes me wonder where we will end up . . maybe some day the keyboard will be integrated in your mouse!

 

Anyway, let's get those buttons work for us:

 

First you need to set up your mouse in XFree86 (When using Xorg the file is /etc/X11/xorg.conf )

$ cat /etc/X11/XF86Config-4

 

( to check if the file is in the right place, if so: )

$ su
< password >
# vi /etc/X11/XF86Config-4

(open the file in vi )

< i > ( put vi in insert mode )

look for the "input device" mouse section and adapt it to look like: ( line 3, 5 and 6 !! )

Identifier "Mouse1"

Driver "mouse"

Option "Protocol" "ExplorerPS/2"

Option "Device" "/dev/psaux"

Option "Buttons" "7"

Option "ZAxisMapping" "6 7"

 

Save and close vi:

Esc

ZZ

 

After that you need to give the command:

# xmodmap -e "pointer =1236745"

 

Then make a script in .kde/Autostart:

$ vi /home/bruno/.kde/Autostart/mouse

(makes the file "mouse" )

< i > ( put vi in insert mode )

 

and put the following lines in there:

#!/bin/shxmodmap -e "pointer = 1 2 3 6 7 4 5"

Save and close vi

Esc

ZZ

 

Once your wheel works you can test to see the extra buttons with < xev > (place mouse in the square and click the buttons and see what happens).

 

Then you need to download the program "imwheel" (1.0.0pre1) you can find it Here and install it.

 

It is a .tar.gz file ( tarball ) see for instructions page 3 of the Tips for Starter!

 

And make a file .imwheelrc in your /home directory:

$ vi /home/bruno/.imwheelrc

 

(creates the file )

< i > (puts vi in insert mode )

 

and add the lines:

".*"None, Up, Alt_L|LeftNone, Down, Alt_L|Right

 

Save and close vi

Esc

ZZ

 

And make a script to start the imwheel program:

$ vi /home/bruno/.kde/Autostart/imwheel

( makes the file in Autostart )

 

< i >

( puts vi in insert mode )

 

With the following lines:

#!/bin/shimwheel -k -b "67"

 

Save and close vi

Esc

ZZ

 

And that is all my friends, now you can simply restart KDE ( or give the command: imwheel -k -b "67" ) and have fun!

 

B) Bruno

 

PS: Thanks to Ryan for testing and providing the link!

 

NOTE: PCLos 9.2 seems to need special treatment, you can read about the solution here: http://forums.scotsn...h...st&p=181607

Share this post


Link to post
Share on other sites

Hey, Bruno! Wonderful! More great tips all the time! B)

Share this post


Link to post
Share on other sites

Thanks Fran !There is more coming ! B)B) Bruno

Share this post


Link to post
Share on other sites

CRON-JOBS and the CRON DAEMON

 

Cron-jobs are maintenance jobs performed automaticly on your system every night, once a week or a month. Jobs like "logrotate" ( refreshing log files and zipping up old ones ) updatebd ( updating your "locate-search" database ) and a lot of other databases like the rpm database. Cron comes from the Greek word chronos ( Time )

 

The program that takes care of this is the Cron-daemon. At a pre-selected time it starts doing the jobs that are to be done. Mostly between 3 and 5 at night because then it does not interrupt the users working hours. (if your computer is off at those times you'll have to install "anacron" that picks up forgotten jobs the next time the computer boots ).

 

There are cron-jobs system wide, general rules that you should not be messing with. But you can add a series of user specific rules.

 

The schedule for cron is written in the /etc/crontab file.

Lets have a look at the system corntab:

$ cat /etc/crontab

 

Will show:

# run-parts

01 * * * * root nice -n 19 run-parts /etc/cron.hourly

02 4 * * * root nice -n 19 run-parts /etc/cron.daily

22 4 * * 0 root nice -n 19 run-parts /etc/cron.weekly

42 4 1 * * root nice -n 19 run-parts /etc/cron.monthly

 

The order of codes here is: minute, hour, day-of-month, month, day-of-week, user and command. The * means any value will do. So the first line tells it every ) 01 minutes, of 1 hour, of every day, of every week and every month "run-parts /etc/cron/hourly" The second line tells it to do the daily jobs at 4.02 hrs. The third line to do on day 0 the weekly job at 4.22. The last line to do every 1st of the month the monthly job at 4.42!

If those times are very inconvenient you could change them to your preferences.

 

O.K so what is in /etc/cron.daily ?

$ cd /etc/cron.daily
$ ls

 

This will show you this:

0anacron - logrotate - makewhatis.cron - msec - rpm - tmpwatch

 

Those are all little scripts for the tasks to be done.

Just add your script ( backup ? ) and it will run with the other daily tasks. Shell or bash script it does not really matter.

 

Example: Have a look at the rpm script now that we are in the right directory:

$ cat rpm

will show you:

#!/bin/sh
rpm -qa --qf '%{name}-%{version}-%{release}.%{arch}.rpm\n' 2>&1 | sort > /var/log/rpmpkgs

 

See ? . . . . . . #!/bin/sh on the 1st line and a "simple" command on the 2nd line!

 

Do explore a little and see what all the hourly to monthly tasks are about.

 

I only did explain all this to you so you would better understand how things are done by the software you are running !

 

B) Bruno

Share this post


Link to post
Share on other sites

UPDATING your URPMI-SOURCES

 

A few pages ago ( page2 ) I told you about adding your urpmi-sources.

From time to time you have to update your urpmi-sources because packages on those mirrors will change and you will no longer be able to use this clever install utility.

 

Updating is as easy as 1 2 3 :As root in a console ( while you're on line ) :

# urpmi.update -a

 

That's all !

 

But then, it's Saturday night, so I would want to put your head through too much stress !

 

B) Bruno

Share this post


Link to post
Share on other sites

COMMANDLINE MP3 PLAYER

 

Sunday is a day to chill-out and listen to a sheer endless stream of music.

Here is a neat little trick for you commandline-lovers that really pays off!

To play ALL mp3's on your computer in random order:

$ mpg123 -Z --list <(locate "*.mp3")

Note: the special characters: -- < " * . " they all have to be there !

To stop playing: Ctrl+c ( 2x )

 

Sure you can play just one song too:

$ mpg123 /home/bruno/music/dylan/To_Ramona.mp3

 

For more options see "man mpg"

 

So now you can listen to some music while tweaking your computer ! :D

Have a nice sunday !

 

B) Bruno

 

PS: A commandline mp3 player uses no GUI thus is extremely easy on systemresources !

Share this post


Link to post
Share on other sites

BASIC RULES FOR INSTALL

 

I know it's a bit late to come with basic install tips, but it looks like a good thing to give a few guidelines:

 

If you want to check first if your hardware is supported try a Live CD

 

1) Don't forget to do a good backup of important data on your computer even if it is on a partition that won't be effected by the install !

 

2) Make a plan in advance on how you want your partitions done ( see Here ) and what filesystem you want to use ( Ext3, ReiserFS etc. See Here and Here )

 

3) Do not uses all your free space of the windows partition, you might want to leave some working-space there for adding new programs or temp files ( CD burning programs need at least 700 MB temp ) we don't want to cripple your windows OS. :)

 

4) BIOS: Put the entry: PnP aware OS on NO ! ( See Here )

 

5) BIOS: First boot device: CD-ROM, second Floppy, third IDE-0

 

6) Connect all printers, scanners, card readers etc. and make sure they are turned on

 

7) Check out the README and INSTALL text files on your CD

 

8) Note down the root-password you make during install. ( once you have used it a couple of times you can burn the evidence :lol: )

 

9) Install the bootloader Lilo or Grub in the MBR ( it will include your windows options automatically ).

 

Pin this on the wall, and read it again every time you make a new install !

 

B) Bruno

Share this post


Link to post
Share on other sites

BASIC MACHINE INFORMATION

 

There are a few commands you can use to get the kernel version , machine number and a couple of other basic info of your computer:

$ cat /proc/version

Will give you a full string of information.

 

$ uname -m

Will give you the machine number ( like i686 )

 

$ uname -r

Will show the kernel version

 

$ uname -n

The localdomain name

 

$ uname -s

The system name

 

$ uname -p

The processor

 

$ uname -a

All info above in one + date and time

 

B) Bruno

Share this post


Link to post
Share on other sites

WHAT IS IN THAT PACKAGE ?

 

Here is a short one:

We can see what is in a package ( rpm or tar.gz or tgz ) , with the following command:

$ less /home/bruno/downloads/package.rpm

( replace "package.rpm" with the name of the file )

 

We will do more tricks with the command "less" another time !

 

B) Bruno

Share this post


Link to post
Share on other sites

Bruno's tips....a little feed back. The HD partitioning ... both my desk top and laptop have a modifed , size wise of the 10 Gb drive , updated and it is working great. last week a Linux friend and I installed Mandrake 9.1 using the 15 Gb + configeration , but as there was no "+" and the /backup was left out. The install picked up both printers, an Epson and a Brothers and the high speed cable connection. One thing the /backup brought forth was the question , where is the Mozilla files (Mail) The mail files and the Mozilla dir are in a hidden file ./Mozilla/.../.../ which can be viewed by making them visiable in the file manager, copy to a safe place on another Hd and restore after installation. The PLF , urmpi information, required a little more thought. My PPPoe needs to be active to make these commands work so I just downloaded a large file to make sure I was connected all three operations worked fine , the plf.asc , urpmi update and urmpi update page Now to arrange all the information in a binder so I can find it .... and last but not least get Xine to work reading DVD's Been a long haul with this program . still not able to run DVD'scharlie from down east Canada ;)

Share this post


Link to post
Share on other sites

Thanks for your feedback Charlie ! And the additional information.Always good to hear that people have good use with the Tips, and there is more of them comming up.So get yourself a large binder ! ;) :) Bruno

Share this post


Link to post
Share on other sites

GETTING IN TEXT MODE and SHUTTING DOWN X

 

There was a question in a thread about installing Nvidia drivers about how do I leave X and get the computer in text mode.

 

There are 2 ways to do that:

 

EITHER:

Ctrl+Alt+F1 (or F2 to F6 ) Will get you out of X

Alt+F7 will get you back in X

 

OR:

$ root
< password >
# init 3 ( will get you in runlevel 3 )
# init 5 ( will get you back in runlevel 5 )

 

Alt+F7 will get you back in X

 

Read also the Tip about "Runlevels"

 

B) Bruno

Share this post


Link to post
Share on other sites

LOST USER PASSWORD

 

Now, just imagine, you have a sudden strike of growing old, and, you forgot your user password. I know it's hard to figure, but weirder things happen !

 

The solution however is simple:

$ su
< root-password >
# passwd bruno

( if that is your username, don't use mine )

 

Type in a new password ( you will likely get an error message, ignore it )

Type in the same password again !

 

Log out as root and log in as user with your new password !

( I said is was easy ! )

 

Next time we will attack the forgotten ROOT password ! A bit more complicated but it sure can be done.

 

B) Bruno

Share this post


Link to post
Share on other sites

LOST ROOT PASSWORD

 

Here is part two. Yesterday we had forgotten our user password and disaster strikes again today we forgot the root password.

 

First, disconnect your PC from the net, pull the cable out !

 

Step 1: For Redhat and Mandrake:

 

Then boot from your first install CD and as the very first screen comes up hit F2 and type:

 

rescue ( For RedHat "linux rescue" )

 

and the computer will boot in rescue mode.

 

It will show a few alternatives, select : "mount the existing partitions" and go to the shell/console prompt.

 

( Booting Mandrake in "failsafe" from the Lilo menu does the same )

 

Step 1: For SUSE:

 

Boot from your first install CD and press F1 at the first screen, then choose "Rescue System" from the menu and at the prompt type "root" ( you do not need a password )

 

 

Step 1: For other distro's

 

Boot from the first install CD ( or any Live CD like Knoppix ) and at the bootprompt type:

linux single

( For Knoppix: knoppix single )

And it will boot in "single user mode" and you will get an odd looking prompt like "sh-2.05b#"

 

Alternative for step 1

Sure with most Live and Rescue CDs you can also just boot in the live version, mount the partition and, as root, make changes to the files indicated below:

 

Step 2

# cd /etc

( if you boot from knoppix first cd to the partition your lost-password-distro is on )

 

We need to change two files; "passwd" and "shadow":

# vi passwd

( opens the file )

< i > ( puts vi in insertmode )

 

This is the first line:

root:x:0:0:root:/root:/bin/bash

 

Make it:

root::0:0:root:/root:/bin/bash

 

So just get writ of the "x" do not touch the ":" ( colons )

Save the file:

Esc

ZZ

 

Second file to be changed:

# vi shadow

( open the file )

< i > ( insert mode )

 

The first line is a long scrambled line of characters, just make it:

 

root:::: ( four colons ! )

Save the file

Esc

ZZ

 

Now you can reboot your computer. Log in as normal user, open a console and type:

$ su# passwd

 

And set the new root password.

 

Log out as root:

 

Ctrl+d

 

And the job is done

 

WARNING: Only after setting your new root password it is safe to connect your computer to the internet or local network again !!

 

B) Bruno

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×
×
  • Create New...