Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
Notices |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
12-03-2002, 10:38 AM
|
#16
|
LQ Newbie
Registered: Nov 2001
Location: Belgium
Posts: 18
Rep:
|
when you get a bash prompt, type 'whoami' ... who knows, you might be root...
|
|
|
12-03-2002, 10:38 AM
|
#17
|
LQ Newbie
Registered: Nov 2001
Location: Belgium
Posts: 18
Rep:
|
and DON'T type login, as you are already logged in .
|
|
|
12-03-2002, 10:51 AM
|
#18
|
LQ Newbie
Registered: Jun 2001
Posts: 17
Original Poster
Rep:
|
I am gina....not root.
|
|
|
12-03-2002, 10:59 AM
|
#19
|
LQ Newbie
Registered: Jun 2001
Posts: 17
Original Poster
Rep:
|
I type "whoami" and it says "cannot find username for UID 0"... I guess I am root, but I cannot change directory to /etc to edit the passwd file... What can I do from the bash prompt?
|
|
|
12-03-2002, 11:06 AM
|
#20
|
LQ Newbie
Registered: Nov 2001
Location: Belgium
Posts: 18
Rep:
|
On my machine, it was not bash but sh# that was started. I could edit /etc/passwd. Don't you have permission ? probably not hu?
cant you do cd /etc ?
if so, goto sh like I did (type sh)
and then try.
(and everytime tell me what he says to)
|
|
|
12-03-2002, 11:07 AM
|
#21
|
LQ Newbie
Registered: Nov 2001
Location: Belgium
Posts: 18
Rep:
|
I'm going home now. I'll cu tomorrow.
|
|
|
12-03-2002, 07:13 PM
|
#22
|
Member
Registered: Nov 2002
Location: Paraguay
Distribution: Mandrake 10
Posts: 573
Rep:
|
download this: www.toms.net/rb and from there edit your passwd file.
|
|
|
12-03-2002, 07:15 PM
|
#23
|
Senior Member
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Mostly Debian based systems
Posts: 4,368
Rep:
|
Surely if booting toyour Linux bootloader into the bootsector of your main Linux partition, and use something rl1 (linux single) logs you in as uid 0 you will still be able to edit the file, even if the user that is associated with uid 0 doesn't exist? In which case, you might be able to fix this without having to download anyting!
|
|
|
12-04-2002, 12:39 AM
|
#24
|
Senior Member
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152
Rep:
|
You should be able to just boot from your install disk, stop the
install w/o rebooting, mount the relevant partition (the one that
contains the /etc/ directory, either edit /mountpoint/etc/passwd
and add the user root, or copy the passwd.bak over passwd (do
you know root's passwd?). If your installation doesn't allow you
to stop the install w/o rebooting, simply hit: ALT-F2. This should
give you another console, from which you can log in as root
(the install has a user root), usually without a password. Then
go on to mount the partition.
|
|
|
12-04-2002, 02:21 AM
|
#25
|
Member
Registered: Nov 2002
Location: Paraguay
Distribution: Mandrake 10
Posts: 573
Rep:
|
Downloading and having tom's root boot has saved me dozens of times... I think that even if you don't use it for this particular case you should have it.
BTW... how did you manage to delete the root user... I mean.. that is something that only the root can do. Does anyone else have access to the root on that server? you should talk to that dude anyway.
|
|
|
12-04-2002, 01:07 PM
|
#26
|
Senior Member
Registered: Feb 2002
Location: Shanghai, CHINA
Distribution: RH 5.0,5.1 6.0,6.1 7.0,7.1,7.2,7.3.,8.0,9.0, RH Enterprise, Fedora C1, C2
Posts: 1,216
Rep:
|
lol, Just re-install the entire system!, you'll save youself from doing all these things....
what the heck happened anyway??, it's not likely that any distro installation let you install without making a root account...
did you get hacked or something??
|
|
|
12-04-2002, 10:49 PM
|
#27
|
Member
Registered: Nov 2002
Location: Paraguay
Distribution: Mandrake 10
Posts: 573
Rep:
|
Come on!!! reinstalling the entire system is a Micro$oft solution. Linux System Administrators know how to solve these kind of problems. I insist, all you need it to boot from a rescue disk and add the root account With UID and GID 0 and you'll be able to do anything. Or even boot in single-user, but if the root was properly deleted you shouldn't be ablo to log in.
|
|
|
12-04-2002, 11:01 PM
|
#28
|
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163
Rep:
|
get Toms root boot and fix it by mounting the filesystem and adding root user. Because when you boot Toms root boot you will be root
|
|
|
12-04-2002, 11:34 PM
|
#29
|
Member
Registered: Nov 2002
Location: Paraguay
Distribution: Mandrake 10
Posts: 573
Rep:
|
Quote:
Originally posted by DavidPhillips
get Toms root boot and fix it by mounting the filesystem and adding root user. Because when you boot Toms root boot you will be root
|
You'll have to mount your root partition and chroot there before adding the user (so it will be added to your root partition /etc/passwd)
|
|
|
12-06-2002, 08:21 AM
|
#30
|
LQ Newbie
Registered: Jun 2001
Posts: 17
Original Poster
Rep:
|
Okay, I don't mean to sound useless, but I created the boot disk from toms.net and I booted up the Linux Server. Can someone tell me how to change to my local drive so that I can change the etc/passwd file? I've been looking in books, but nothing helpful..
Thanks for any help you've given me or can give me.
|
|
|
All times are GMT -5. The time now is 09:30 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|