Quote:
Originally Posted by SnugNuts
I screwed up. I had my buddy help me with the installation for f16, and he didn't use my name, he used another name of someone else he was helping out. I looked up how to change your username, it said to edit the /etc/passwd file. I knew this was bad, I always heard, "never do this." Well I did it... I was running XBMC and it crashed on me, when I brought the server back up, I try to log in with both my username and the old username, and I get authentication failed, for both accounts. When I try to pull up a terminal (alt+ctrl+f2) I get a black screen with a box on the bottom, that is split in the middle, half yellow and half grey. Any idea on what I need to do?
---------- Post added 4th July 2012 at 06:58 AM ---------- Previous post was 3rd July 2012 at 11:29 PM ----------
Anyone help a noob out? 
|
Hi SnugNuts
Another way to rectify your problem would be to use, as root, the commands 'groupmod' and 'usermod' as follows.
Once you have logged in to your machine, with the unfortunately incorrect name, open a terminal and become 'root'. This is done by invoking <su -> in a X terminal. It will need your root password and hit enter.
Once you are in a terminal as root, shown by a # at the prompt, type in the following <init 3> and hit enter. This will leave the GUI session and put you into a console mode. You must login as <root> and again put in the root password and hit enter.
You should now have a console with a # and a prompt. At the prompt type the following and hit enter after each line. You must substitute your name where I have used 'newname' and the incorrect name where I use 'oldname'. The beauty of the following is that ALL settings and apps/settups are retained and you do not have to remove any users or whatever.
So at the prompt type 'groupmod -n newname oldname' and hit enter.
Then type 'usermod
-l newname oldname' and hit enter.
Note, that is a letter not a number.
Then type 'usermod -m -d /home/newname newname' and hit enter.
Next type 'init 6' and hit enter.
Please be advised that if you have 'autologin' enabled you MUST disable it before starting this procedure or you will not be able to login.
You should be brought back to your GUI and have a login screen. Use your newname and old password and log in. Now you can enter the Users and Groups app and change your Displayed name shown at the upper corner of the screen. Remember this is just an Displayed Name and is not your 'username'
This procedure, if followed precisely, will change any username and groupname to whatever you desire and maintain all permissions, ownership etc that was there for the original user.
Caution: Make sure that you type the exact code as written and wait for each command to finish before entering the next one.
YMMV. Enjoy...