LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   seems I locked myself out... (http://www.linuxquestions.org/questions/linux-newbie-8/seems-i-locked-myself-out-457955/)

adin 06-24-2006 04:57 PM

seems I locked myself out...
 
------------------------
What commands will allow a restricted user to login?
------------------------
background:
Installed Debian flavor that came on my knoppix dvd.

I have three partitions:
hda1=windowsxp, hda2=debian, hda3=empty

I used the command as a user:
sudo dd if=/dev/hda1 of=/dev/hda3
to image my windows installation but got an error message something like "tried to ... as ... this incident will be reported."

I tried it again as root, and it worked well.

After that my username was restricted.
Now I can't login, except as root, and only to the terminal.

Oh, and root got a mail telling of the incident.
I don't want to login as root all the time, and I can't
use GUI as root.

Help?

Thanks.

~A

bulliver 06-24-2006 08:52 PM

I can say that regular users do not generally have access to block devices such as you were trying. I have no idea why you were 'restricted' but there are a few ways of doing this you can check:

1. Open /etc/password (as root) and look for your username. If there is an '*' in the second field then change it to 'x'. If it says '/bin/false' i n the last field, change it to '/bin/bash' or your favorite shell.

2. Open /etc/limits and have a look if you can see: "<username> L0" and change the '0' to a positive number (this is the maximum number of concurrent logins allowed for your user).

3. Maybe some sort of PAM damage, in which case I have no idea...

burntfuse 06-24-2006 08:53 PM

You can log in as root and create a new user account for yourself with the 'adduser' command - see this page for details.

adin 06-24-2006 10:10 PM

thanx
 
thanks for the help, but until i get a better understanding of how to manage user accounts, I'll be better off deleting it and creating a new one, as suggested.

this link tells how to add a user, but how do you remove one?

bulliver 06-24-2006 10:29 PM

Quote:

thanks for the help, but until i get a better understanding of how to manage user accounts, I'll be better off deleting it and creating a new one, as suggested.
Hogwash. I just told you two ways to check for a locked out user. If you had followed through perhaps you might have gotten "a better understanding of how to manage user accounts".

Quote:

I'll be better off deleting it and creating a new one, as suggested.
That is the MS way of doing things.

Quote:

this link tells how to add a user, but how do you remove one?
You delete their entry in /etc/passwd and /etc/shadow, then delete their home directory.

I suppose you will want to keep the data and settings in your home directory. To do this you will have to make sure the new user you create has the same UID as your old user or else you will not have permissions on the file (look at the --uid option to adduser). If you already created a user and you have a different UID then you will need to recursively chown all of the files.

Are you learning yet? Good thing you didn't take a quick look at a simple text file like I suggested ;)

Not trying to be a bitch here, but really. If you are not willing to dive head in you will not find much joy in Linux...


All times are GMT -5. The time now is 02:33 AM.