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!

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.

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.

Sorry for the repost, I posted this in general but didn't see there was a newbie section.

I just finished installing Kubuntu and configuring it all, it took me more than a whole day. Now I know this is retarded, but I thought that for the good of my PC's security, I should only have two accounts: root and my own account. So i userdel'd all the other accounts I found in /etc/passwd, now it won't connect to the internet and it certainly is due to this. Is there any way I could restore all the system accounts I deleted??

Sorry for the repost, I posted this in general but didn't see there was a newbie section.

I just finished installing Kubuntu and configuring it all, it took me more than a whole day. Now I know this is retarded, but I thought that for the good of my PC's security, I should only have two accounts: root and my own account. So i userdel'd all the other accounts I found in /etc/passwd, now it won't connect to the internet and it certainly is due to this. Is there any way I could restore all the system accounts I deleted??

I have one solution that may work for you. Boot up the Kubuntu CD as a Live CD.

1) Mount your drive read-write (should be something like /dev/hda1 and it should be mounted in /mnt/hda1)

2) Navigate on your hard drive (/dev/hda1) to find the hard drive's /etc/passwd (/mnt/hda1/etc/passwd) and open it (it should contain only the lines you didn't delete). You might have to be root.

3) open the Live CD's /etc/passwd (Navigate with Konqueror to the / directory then /etc). This file should have all of the system services and stuff that were present on your original install, but might be missing some of the ones you setup after that.

4) Copy the contents from /etc/passwd to /dev/hda1/etc/passwd but be careful not to overwrite the file or delete the lines you left (which should be your user).

5) Save the file /dev/hda1/etc/passwd and reboot into your install. You should now have all the other users back at least from the base install.
If you installed other programs, like apache2, you'll have to reinstall them sudo aptitude reinstall apache2. Just be sure to save the config files you modified (copy them to to something like file.conf.new or something like that). That way you'll be sure they don't over write your changes and if it does, you can just copy the file back.

Now, you've learned a couple of important things here. The first is that you need to read a bit more about how linux works. You'll find that programs and services create users for themselves in linux that give them restricted permissions on what they can do. For example, ssh creates a user "ssh" so it has restricted permissions. On windows and ssh server will run as Adminstrator or System and have full access to everything. So a security flaw will compromise your system. On linux, the system may be partially compromised, but at least the hacker won't have full root access.

The second thing you should have learned from this is to always make a copy of system files before you start mucking with them. sudo cp filename.conf filename.conf.orig is your best friend when you screwed up a file. I even do it for simple files in my /home folder (like .bash_profile and .bashrc).

Third, this might be one case where reinstallation isn't a bad thing. I know it took you a whole day to setup this time how you wanted it, but it's possible that you could do it a lot faster the 2nd time around. If this was your first ever linux install, reinstalling might even be fun. So consider that if you think this is too difficult.

Anyway, welcome to Linux! With great power comes great responsibility. I'd take some time once you're up and running again to read some of the newbie docs around the web. If you search around these forums, you'll find some other helpful links. But here's a few:

Please do not post the same thread in more than one forum. Picking the most relevant forum and posting it once there makes it easier for other members to help you and keeps the discussion all in one place.