[opensuse] User name typo error when installing oS - how to rectify
When I installed 11.1 the other day I mistyped the user name and ended up with having "fed" instead of "fred" as my user name and consequently the home directory is also named "fed". I want to change it to "fred". If I booted into the oS with init 1, issued the command chown -R fred.users /home/fed and then altered in Yast's User Management the user "fed" to "fred" (after logging in as root) and also renamed the current home directory to "fred" and rebooted the system, would this rectify the typing error I made - with no ill effects on the system? (Oh yes- I would also clean out the /tmp directory.) Any suggestions (polite ones of course) would be most welcome. Ciao. -- "I do not instruct the uninterested; I do not help those who fail to try. If I mention one corner of a subject and the pupil does not deduce therefrom the other three, I drop him." Confucius -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thursday 29 January 2009 13:30:00 Basil Chupin wrote:
When I installed 11.1 the other day I mistyped the user name and ended up with having "fed" instead of "fred" as my user name and consequently the home directory is also named "fed".
I want to change it to "fred".
If I booted into the oS with init 1, issued the command
chown -R fred.users /home/fed
and then altered in Yast's User Management the user "fed" to "fred" (after logging in as root) and also renamed the current home directory to "fred" and rebooted the system, would this rectify the typing error I made - with no ill effects on the system?
(Oh yes- I would also clean out the /tmp directory.)
You have the order of operation wrong, but otherwise it will work. The first thing you need to do is to change the name of the user. Then you can rename the home directory You don't need to chown it though, changing the username will not alter the user ID, and it is the user ID that determines owner. Actually, all you really need to do is 1. log out 2. log in as root 3. edit /etc/passwd and change the username and name of the directory 4. mv /home/fed /home/fred and you're done. You don't have to go to runlevel 1 to do it Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Anders Johansson skrev:
On Thursday 29 January 2009 13:30:00 Basil Chupin wrote:
When I installed 11.1 the other day I mistyped the user name and ended up with having "fed" instead of "fred" as my user name and consequently the home directory is also named "fed".
I want to change it to "fred".
If I booted into the oS with init 1, issued the command
chown -R fred.users /home/fed
and then altered in Yast's User Management the user "fed" to "fred" (after logging in as root) and also renamed the current home directory to "fred" and rebooted the system, would this rectify the typing error I made - with no ill effects on the system?
(Oh yes- I would also clean out the /tmp directory.)
You have the order of operation wrong, but otherwise it will work.
The first thing you need to do is to change the name of the user. Then you can rename the home directory
You don't need to chown it though, changing the username will not alter the user ID, and it is the user ID that determines owner.
Actually, all you really need to do is
1. log out 2. log in as root 3. edit /etc/passwd and change the username and name of the directory 4. mv /home/fed /home/fred
and you're done. You don't have to go to runlevel 1 to do it
Anders
Hi just my two cents... should you not also change the 'fed' entry in /etc/shadow ? and check the /etc/group file?? -- ------------------------------ Med venlig hilsen/Best regards Verner Kjærsgaard Open Source Academy +45 56964223 Novell Certified Linux Professional 10035701 ------------------------------ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thursday 29 January 2009 13:46:13 Verner Kjærsgaard wrote:
just my two cents... should you not also change the 'fed' entry in /etc/shadow ? and check the /etc/group file??
Yes, excellent point, I left that out. Sorry Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Verner Kjærsgaard wrote:
just my two cents... should you not also change the 'fed' entry in /etc/shadow ? and check the /etc/group file?? That is probably the reason why the "usermod" command was invented.
usermod --login=fred --home=/home/fred --move-home fed will get the job done. Regards nordi -- Spam protection: All mail to me that does not contain the string "suse" goes to /dev/null. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
nordi wrote:
Verner Kjærsgaard wrote:
just my two cents... should you not also change the 'fed' entry in /etc/shadow ? and check the /etc/group file??
That is probably the reason why the "usermod" command was invented.
usermod --login=fred --home=/home/fred --move-home fed
will get the job done.
Regards nordi
Thank you for your suggestion - however I could not make it work. The main error was that the actual directory represented by "--move-home fed" did not exist according to usermod. And getting a blank line when one executed 'usermod --usage' did not help at all :-) . As you may have read in my reply to Anders I repaired my typing error and now have my correct logon name. Ciao. -- "I do not instruct the uninterested; I do not help those who fail to try. If I mention one corner of a subject and the pupil does not deduce therefrom the other three, I drop him." Confucius -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Anders Johansson wrote:
On Thursday 29 January 2009 13:30:00 Basil Chupin wrote:
When I installed 11.1 the other day I mistyped the user name and ended up with having "fed" instead of "fred" as my user name and consequently the home directory is also named "fed".
I want to change it to "fred".
If I booted into the oS with init 1, issued the command
chown -R fred.users /home/fed
and then altered in Yast's User Management the user "fed" to "fred" (after logging in as root) and also renamed the current home directory to "fred" and rebooted the system, would this rectify the typing error I made - with no ill effects on the system?
(Oh yes- I would also clean out the /tmp directory.)
You have the order of operation wrong, but otherwise it will work.
The first thing you need to do is to change the name of the user. Then you can rename the home directory
You don't need to chown it though, changing the username will not alter the user ID, and it is the user ID that determines owner.
Actually, all you really need to do is
1. log out 2. log in as root 3. edit /etc/passwd and change the username and name of the directory 4. mv /home/fed /home/fred
and you're done. You don't have to go to runlevel 1 to do it
Anders
Sorry for not replying sooner but I was testing your suggested way of resolving my typing error. Many thanks to you and to Verner for the instruction on what had to be done to alter the logon name to the correct one and the list of files which had to be edited. Everything worked fine - except for 2 things: Thunderbird and FireFox, while they started OK, both "lost" the theme I had for each and reverted to the default themes; in addition all the extensions I had became inoperative even though they were still listed in the Addons. Took a little while to find the reason for this and resolve the issue. In addition to the files in /etc which you and Verner mentioned (group, passwd, shadow), in both ~/.mozilla and ~/.thunderbird one has to edit the extensions.ini and prefs.js files to reflect the user's change of name so that 'things' point to the correct directories in /home. Also, after making these changes for mozilla and thunderbird it was necessary (unusual I know) to reboot the sysem before the changes took effect; simply restarting Firefox and Thunderbird left both without extensions and with the default themes. (While FF and TB are now working as before I now wonder if there any other apps which may be similarly affected.) Ciao. -- "I do not instruct the uninterested; I do not help those who fail to try. If I mention one corner of a subject and the pupil does not deduce therefrom the other three, I drop him." Confucius -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Friday 30 January 2009 06:32:02 am Basil Chupin wrote:
Also, after making these changes for mozilla and thunderbird it was necessary (unusual I know) to reboot the sysem before the changes took effect; simply restarting Firefox and Thunderbird left both without extensions and with the default themes.
It was enough to logout from old name and login in new name.
(While FF and TB are now working as before I now wonder if there any other apps which may be similarly affected.)
Every application that remembers absolute path to home directory instead to look for $HOME will be lost. You can grep/search for /home/<old_user_name> and see what files contain absolute path. Mine is running for a while and it collected quite a few files :-) Not all are configuration, but there are some that have absolute path. I have this home directory for a quite some time, so you should have your list faster. -- Regards, Rajko -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (5)
-
Anders Johansson
-
Basil Chupin
-
nordi
-
Rajko M.
-
Verner Kjærsgaard