LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices


Reply
  Search this Thread
Old 12-30-2003, 03:54 AM   #1
Alt-F4witty
LQ Newbie
 
Registered: Oct 2003
Location: Vietnam
Distribution: Debian Linux 2.84
Posts: 2

Rep: Reputation: 0
cannot log in as root in bash .?


In root, i am newbie. and test change shell command as chsh /etc/bash2.....
and now i cannot log in as root. It said: Cannot execute /bin/bash2: No such file or directory

I cannot log in as root so I cannot change anything in file /etc/passwd

When i boot by Floppy disk (Knoppix 3.2), it have only mini shell and cannot mount Floppy diskette....

Thanks when you read....Help me please

hoangviet17777(at) yahoo.com
 
Old 12-30-2003, 05:44 AM   #2
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
The shell you specify has to be a valid executable file. If not you're going to get an error trying to log in. So either boot in single user mode (type linux single at the boot prompt) or boot Knoppix or some other CD-based distribution so you can perform a rescue operation, then edit the file /etc/passwd on your installed Linux system (meaning, not the one on the CD ).You will probably see a line that looks like this:
Code:
root:x:0:0:root:/root:/etc/bash2
Change that to read:
Code:
root:x:0:0:root:/root:/bin/bash
You usually don't have to specify bash2 as the shell if you want Bash 2.x. Bash 2.x is distributed as the standard Bash shell on most current Linux distributions - try logging in as yourself and type bash --version to see what version you're running.


Håkan
 
Old 12-30-2003, 05:48 AM   #3
lone_nut
Member
 
Registered: Dec 2003
Location: Denmark
Distribution: Mandrake
Posts: 179

Rep: Reputation: 30
If you can log in as ANY other user, you can type
su "vi /etc/passwd"
(in a console, if you look in in a graphic environment)
you will then be asked, for roots password. Type it in.
you look on a file, that has on entry per line. Every entry look like the following:
userassword:uid:gid:comment:home_directory:startup_shell
roots entry should be at the first line, change the bash2 to bash3
type <esc> and then type :wq (it will quit insert mode, and put you in command mode, save the file and quit vi).
now you should be able to log in as root
you should now
 
Old 12-30-2003, 10:04 PM   #4
Alt-F4witty
LQ Newbie
 
Registered: Oct 2003
Location: Vietnam
Distribution: Debian Linux 2.84
Posts: 2

Original Poster
Rep: Reputation: 0
cannot save what i modify passwd by user

i cannot save what something to /bin/bash in /etc/passwd or more as a user (not root) so i cannot modify anything in this file.

When i boot Knoppix 3.2 Floppy diskette, it have only mini shell, and when i use mount /dev/hdaX /mnt and system warning: Invalid argument

Everybody, please help me to fix the error...
I am newbie in Linux, start to how to use Linux and the problem is harder for me to fix.

Thanks all again,

HVN
 
Old 01-05-2004, 11:59 AM   #5
lone_nut
Member
 
Registered: Dec 2003
Location: Denmark
Distribution: Mandrake
Posts: 179

Rep: Reputation: 30
mount needs to know, the type of file system, you are using on the hard disk partion. There are a few choice's you can take: (Try them
all, it don't hurt, all you get is an error)
-t vfat
if your have installed them on a m$ partion (not very likely)
-t ext2
if you have them installed on a non journaling linux drive (I can't check ore remember, but it thinks this is the default.)
-t ext3
This the journaling version of the file system.
To mount a non journaling file system on hda1 (first harddisk, first partion) do:
mount -t ext2 /dev/hda1 /<some empty directory>
Remember to check, that /mnt is empty. if it is not, create a directory under it.
Hope it helps
(I can remember, when i started to do linux, i could not figure out to shutdown the computer, some ha)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
lfs-6.1 Bash-3.0 [make test]log:could be error to continue?? ukyo Linux From Scratch 2 08-25-2005 07:35 AM
Cant only log in as root after user log-in. ADJenkins Linux - General 2 11-17-2004 04:18 PM
Log Out root Then Log In As Other User xtremcoder Linux - General 4 10-04-2004 11:01 PM
pesky bash shell error every time I log in illiniguy3043 Linux - Newbie 1 06-12-2004 01:54 PM
Log on as Root, or switch to Root, in MDK 9.1 - KDE 3.1.0 snorky Mandriva 3 09-01-2003 12:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook

All times are GMT -5. The time now is 06:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration