 |
 |
 |
 |
| Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum. |

18th April 2005, 06:10 AM
|
|
Registered User
|
|
Join Date: Apr 2005
Posts: 44

|
|
|
changing username
How insanely hard is it to rename a user?
I don't mean just creating a new user with the "right" name, but actually changing the username.
|

18th April 2005, 07:05 AM
|
 |
Registered User
|
|
Join Date: Feb 2004
Age: 44
Posts: 8,256

|
|
|
In your fedora box or in the forum?
|

18th April 2005, 03:42 PM
|
|
Registered User
|
|
Join Date: Apr 2005
Posts: 44

|
|
Quote:
|
Originally Posted by imdeemvp
In your fedora box or in the forum?
|
My bad, I was up late! My linux box. I know you can change just the username, but I want to change everything
username, home directory etc.
Rob
|

18th April 2005, 04:19 PM
|
 |
Registered User
|
|
Join Date: Apr 2005
Location: 1 to Rule All way, Moria Gate, Middle Earth, SAU 70N
Posts: 134

|
|
login with a different user, *not* the one you want to change.
[user]$ su - (become root)
[root]#usermod -l new_name -d new_home
you're all set.
VS
|

18th April 2005, 04:24 PM
|
|
Registered User
|
|
Join Date: Apr 2005
Posts: 44

|
|
Quote:
|
Originally Posted by VStrider
login with a different user, *not* the one you want to change.
[user]$ su - (become root)
[root]#usermod -l new_name -d new_home
you're all set.
VS
|
What are the consequences of doint that? I'm assuming I'll have to change all the scripts that point at the old username? Or will the userid stay the same?
|

18th April 2005, 04:28 PM
|
 |
Registered User
|
|
Join Date: Apr 2005
Location: 1 to Rule All way, Moria Gate, Middle Earth, SAU 70N
Posts: 134

|
|
|
the uid will stay the same. however if you have any custom scripts that point explicitly to your previous home dir, change them to point to your new home or better make them point to it implicitly.
Edit:
also don't forget to get your hidden folders from your old dir to your new dir. they have all the settings for your programs.
Last edited by VStrider; 18th April 2005 at 04:47 PM.
|

18th April 2005, 05:17 PM
|
|
Registered User
|
|
Join Date: Apr 2005
Posts: 44

|
|
Quote:
|
Originally Posted by VStrider
the uid will stay the same. however if you have any custom scripts that point explicitly to your previous home dir, change them to point to your new home or better make them point to it implicitly.
Edit:
also don't forget to get your hidden folders from your old dir to your new dir. they have all the settings for your programs.
|
I don't follow what you mean by point to it implicitly? You mean via the UID ?
Rob
|

18th April 2005, 07:28 PM
|
 |
Registered User
|
|
Join Date: Apr 2005
Location: 1 to Rule All way, Moria Gate, Middle Earth, SAU 70N
Posts: 134

|
|
Quote:
|
Originally Posted by slagazor
I don't follow what you mean by point to it implicitly? You mean via the UID ?
Rob
|
implicit paths are those paths which are based on enviroment variables.
eg. if your script points to $HOME, even if you change your home dir it'll still work, cause the variable $HOME now points to the new home path.
but if your script points to lets say /home/myuser1 (explicitly) and you change your home to /home/myuser2 your script will not work cause it'll still point to /home/user1 which doesn't exist.
i suppose system scripts, all use enviroment variables. you only need to check your own scripts.
Edit:
to see this in action, type echo $HOME and you'll see where it points to.
now when you do usermod -d newhome, do the echo $HOME again and voila it points to your new home.
Last edited by VStrider; 18th April 2005 at 07:35 PM.
|

18th April 2005, 07:41 PM
|
|
Registered User
|
|
Join Date: Apr 2005
Posts: 44

|
|
Quote:
|
Originally Posted by VStrider
implicit paths are those paths which are based on enviroment variables.
eg. if your script points to $HOME, even if you change your home dir it'll still work, cause the variable $HOME now points to the new home path.
but if your script points to lets say /home/myuser1 (explicitly) and you change your home to /home/myuser2 your script will not work cause it'll still point to /home/user1 which doesn't exist.
i suppose system scripts, all use enviroment variables. you only need to check your own scripts.
Edit:
to see this in action, type echo $HOME and you'll see where it points to.
now when you do usermod -d newhome, do the echo $HOME again and voila it points to your new home. 
|
Wow, i've got a lot of scripts that point to explict things...(i'm still a newb) maybe I'll just create a new account and rebuild everything....and do it right this time. I'm learning so much these days it's not even funny :-)
|

18th April 2005, 08:07 PM
|
 |
Registered User
|
|
Join Date: Apr 2005
Location: 1 to Rule All way, Moria Gate, Middle Earth, SAU 70N
Posts: 134

|
|
at least you only need to learn these things once.
windows is not much different in this. you have env vars there too. eg. someone might have C:\Windows\System, while someone else might have D:\Win32\System, but they both have %System% which points to the right dir.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 12:19 (Tuesday, 21-05-2013)
|
|
 |
 |
 |
 |
|
|