Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Yes when using knoppix I chose linux single linux single at the boot prompt. I changed the root password but when rebooting the server I end up at a login prompt and it does not recognize the password. Also, grub does not have any hidden entries or passwords. I set the timeout to 10 seconds and now get a blank screen for 10 seconds.
That sounds like you were changing things in the LiveCD working image(s), not in things on your HD. To make changes to your HD, you have to mount the HD's filesystem(s), and work with them, not the LiveCD file systems.
Assuming you're using the SystemRescue livecd, you can boot to a Gentoo GUI interface, with a terminal window open. Or you can choose to just stay with the rescue console. The suggestions below should all work with both choices, except for the last command (geany which is a GUI editor, so it need a running X-windows system.
In the terminal, enter the following commands (Anything from a # to the end of a line is a comment):
fdisk -l /dev/sd? # This will list all the partitions on all your hard drives
# Here's a sample output with comments
#Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors #Hard drive a represented symbolically a sda, sdb, ...; disk drives as sdr, sdro, stc.
#Units = sectors of 1 * 512 = 512 bytes # These three lines are the description of the physical layout of the drive
#Sector size (logical/physical): 512 bytes / 512 bytes
#I/O size (minimum/optimal): 512 bytes / 512 bytes
#Disk label type: dos # The "label" is the partition method use for the drive
#Disk identifier: 0x767f9c5a
# Device Boot Start End Blocks Id System # This is the description of each partition
#/dev/sdb1 * 16065 902435309 451209622+ 83 Linux # The first partition (/dev/sda1) is a Linux partition
#/dev/sdb2 902436864 1926443007 512003072 fd Linux raid autodetect # The second one is a special use Linx one
#/dev/sdb3 1926443008 3907028991 990292992 7 HPFS/NTFS/exFAT # The third is a Windows partition
# Review your output to identify your Linux partitions.
# ASSUMING that one of them is /dev/sda1 try this (Note: Unless only one partition is a Linux one,
# the most likely partition is one not flagged as a "boot" partition.)
mount /dev/sda1 /mntls /mnt/etc
# If this command fails, try another Linux partition.
# enter these commands to do that:
# exit # To quit the chroot process
# umount /mnt # To unmount the partition. (No "n" after the "u.")
# mount /dev/sda2 # To mount the second partition.
# and try the ls command again.
cat /etc/issue # To see what flavor of Linux is on the HD.
# You should see something like this
# cat /etc/issue
#Fedora release 19 (Schrödinger’s Cat)
#Kernel \r on an \m (\l)
# Now change your base file system to be the partition you identified on your HD
chroot /mntpasswd # To change the "root" password
sync # To make sure that the changes are written to the HD
# Now, at this point you've change the root password, so you can reboot and see if you can proceed from there
# or you can try to edit the grub files.
# To do that, using the SysRescue tools do this:
exit # To close the chroot session
ls /mnt/boot # To see if the HD's boot directory is mounted.
# If the directory listing is empty, your distribution may use a separate boot partition.
# Try mounting any other Linux partitions you identified as /mnt/boot
# mount /dev/sda1 /mnt/boot
# And, once again, try the ls /mnt/boot
#Once the /mnt/boot directory contains a grub subdirectory, look in it to find the GRUB
# boot file.
# And edit it
mount --bind /dev /mnt/dev
mount: mount point /mnt/dev does not exist
mount --bind /sys /mnt/sys
mount: mount point /mnt/sys does not exist
Should not be difficult to change root password. I have vi passwd and shadow and rebooted to still end up at some login that does not accept root/password. Following both ptrenholme (above) and various knoppix online user instructions. I have tried the gui and started a terminal and cli boot#linux single, mounted sda2 which fdisk -l shows as boot partition.
This is NOT what you want to see. Try a ls /mnt/sda2 or a ls /mnt/sda3 and look for something like I posted above.
I suspect that /mnt/sda2 will have your /boot files in it, and /mnt/sda3 will have the rest of you system
in it, so the ls /mnt/sda3 output will look similar to what I posted.
ASSUMING that is correct do the following:
mount /dev/sda2 /mnt/sda3/boot
mount --bind /dev/proc /dev/sda3/proc
mount --bind /dev/sys /dev/sda3/sys
Here's an example using an older Fedora system mounted as /Mirror (I.e., /dev/sda3 on your system if my ASSUMPTION is correct)
I've added comments in red to this example.
$ ls -1 /Mirror/ # Check that this looks like a linux base (/) file system.
$ ls /Mirror/boot/ # If my assumption is correct, you should see something like this after mounting /dev/sda2 as /mnt/sda3/boot
boot-isos initramfs-3.8.11-200.fc18.x86_64.img ubnfilel.txt
config-3.8.11-200.fc18.x86_64 initramfs-3.8.8-202.fc18.x86_64.img ubnpathl.txt
config-3.8.8-202.fc18.x86_64 initramfs-3.8.9-200.fc18.x86_64.img vmlinuz-3.8.11-200.fc18.x86_64
config-3.8.9-200.fc18.x86_64 initrd-plymouth.img vmlinuz-3.8.8-202.fc18.x86_64
custom.cfg.new System.map-3.8.11-200.fc18.x86_64 vmlinuz-3.8.9-200.fc18.x86_64
$ ls /Mirror/proc # Since the kernel creates this, it should be empty if the system is not running
$ sudo mount --bind /proc /Mirror/proc$ sudo mount --bind /sys /Mirror/sys$ sudo chroot /Mirror/ # This moves the root fs and starts a root login session on /mirror# cat /etc/issue # Just so you can see that the root fs was moved
Fedora release 18 (Spherical Cow)
Kernel \r on an \m (\l)
## I didn't execute this block of commands since haven't lost my passwords . . .
# passswd # To change the root password
# /home/ # To see which home directories (users) are defined.
# passwd Peter # To change a user's password.
# exit # This exits the root shell.
$ cat /etc/issue # To show that we're back
Fedora release 19 (Schrödinger’s Cat)
Kernel \r on an \m (\l)
$ sudo umount /Mirror/proc /Mirror/sys # Housekeeping: No reason to keep the mounts after I'm done
Last edited by PTrenholme; 05-31-2013 at 12:41 AM.
I was able to vi passwd and shadow, bring up eth0 and assign ip, netmask and route. I can ping it from another subnet now. Is there anyway to test both the root/new password and ip addressing "took" before I close this terminal and restart the server?