Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 18th April 2005, 06:10 AM
slagazor Offline
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.
Reply With Quote
  #2  
Old 18th April 2005, 07:05 AM
imdeemvp's Avatar
imdeemvp Offline
Registered User
 
Join Date: Feb 2004
Age: 44
Posts: 8,256
In your fedora box or in the forum?
__________________
HELP with JAVA, MP3's, Wireless, Repo's, YUM, Partitions, System Monitors, Nvidia, ATI drivers, LIMEWIRE PRO & MORE!.

Easiest and most friendly desktop ever is PCLinuxOS! Includes all this apps. Just try it.

"The greater the struggle THE greater the achievment."

Do you know HIM?

If you are an idiot click here. NThis will test you linux skills :D
Reply With Quote
  #3  
Old 18th April 2005, 03:42 PM
slagazor Offline
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
Reply With Quote
  #4  
Old 18th April 2005, 04:19 PM
VStrider's Avatar
VStrider Offline
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
Reply With Quote
  #5  
Old 18th April 2005, 04:24 PM
slagazor Offline
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?
Reply With Quote
  #6  
Old 18th April 2005, 04:28 PM
VStrider's Avatar
VStrider Offline
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.
Reply With Quote
  #7  
Old 18th April 2005, 05:17 PM
slagazor Offline
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
Reply With Quote
  #8  
Old 18th April 2005, 07:28 PM
VStrider's Avatar
VStrider Offline
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.
Reply With Quote
  #9  
Old 18th April 2005, 07:41 PM
slagazor Offline
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 :-)
Reply With Quote
  #10  
Old 18th April 2005, 08:07 PM
VStrider's Avatar
VStrider Offline
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.
Reply With Quote
Reply

Tags
changing, username

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Username and password??? kcdude Installation and Live Media 7 24th November 2007 09:06 AM
changing username Ospreyeagle Using Fedora 1 25th February 2006 12:40 AM
Changing Username mick-porter Using Fedora 4 18th February 2006 05:08 PM
samba username vels Using Fedora 0 19th August 2004 12:59 PM


Current GMT-time: 12:19 (Tuesday, 21-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat