The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Changing Username

Discussion in 'General Discussion' started by purplepaws, Oct 26, 2002.

  1. purplepaws

    purplepaws Well-Known Member

    Joined:
    Jan 15, 2002
    Messages:
    153
    Likes Received:
    0
    Trophy Points:
    16
    When trying to change a users username using the modify an account function in WHM we get this message.....

    FIXME: This functionality is currently not implemented
    Unable to change user name

    How can we change a users username if this doesnt work?
     
  2. macian

    macian Member

    Joined:
    Oct 17, 2002
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    FIXME: This functionality is currently not implemented

    Yes I am having the same problem trying to change a username.
     
  3. mikerayner

    mikerayner Well-Known Member

    Joined:
    Apr 10, 2002
    Messages:
    192
    Likes Received:
    0
    Trophy Points:
    16
    [quote:d5ee9c92d9][i:d5ee9c92d9]Originally posted by macian[/i:d5ee9c92d9]

    Yes I am having the same problem trying to change a username.[/quote:d5ee9c92d9]
    I think you cannot change username from WHM because this functionality hasn't been implemented yet by Developers
     
  4. rinty

    rinty Well-Known Member

    Joined:
    May 31, 2002
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    6
    you can not change usernames at this time... only way around it is to terminate the account and recreate....
     
  5. wacnstac

    wacnstac Well-Known Member

    Joined:
    Mar 11, 2003
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    6
    Well this creates a real problem for me since I need to transfer 2 accounts from 2 different servers both of which have the same username. Any ideas anybody?
     
  6. Johnnie Nelke

    Johnnie Nelke Active Member

    Joined:
    Jan 9, 2003
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    USA
    You are just going to have to create one of them by hand...... sad fact until CPanel sets this up......
     
  7. wacnstac

    wacnstac Well-Known Member

    Joined:
    Mar 11, 2003
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    6
    How about this script? Has anybody tried it and run it sucessfully? Copying either of these two by hand and setting things up properly would be a real pain, and it is also my understanding that the account would and could not then be recognized by cpanel, ... is this true?
     
  8. spoony

    spoony Member

    Joined:
    Mar 14, 2002
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Here is a script to rename users.

    http://forums.burst.net/showthread.php?s=&threadid=37

    compliments of TheVoice

    <edit>
    And of course brandonk :D
    </edit>


    cd /
    pico

    Then copy the following code and right click to paste it into your pico session.

    code:
    --------------------------------------------------------------------------------

    #!/bin/sh
    # old username
    username1='oldusername'

    # new username
    username2='newusername'


    # edit /etc/passwd
    perl -pi -e "s/$username1/$username2/g" /etc/passwd

    # edit /etc/shadow
    perl -pi -e "s/$username1/$username2/g" /etc/shadow

    # edit /etc/group
    perl -pi -e "s/$username1/$username2/g" /etc/group

    #going into users directory
    cd /var/cpanel/users

    # chaning cpanel file
    mv $username1 $username2

    # editing httpd.conf
    perl -pi -e "s/User $username1/User $username2/g" /usr/local/apache/conf/httpd.conf
    perl -pi -e "s/Group $username1/Group $username2/g" /usr/local/apache/conf/httpd.conf
    perl -pi -e "s&/home/$username1/&/home/$username2/&g" /usr/local/apache/conf/httpd.conf

    #going into home directory
    cd /home

    # moving main directory
    mv $username1 $username2

    # replacing every instance of /home/username in every file in the new main directory
    # this will fix most cgi problems with changing directory paths
    # if you don't need this comment it out as it takes awhile
    find /home/$username1 -type f -exec perl -pi -e "s/\/home\/$username1/\/home\/$username2/g" {} \;

    # setting permissions
    chown -R $username2 /home/$username2
    chgrp -R $username2 /home/$username2

    # running necessary cpanel updates
    /scripts/updateuserdomains
    /scripts/mailperm
    /scripts/ftpupdate

    --------------------------------------------------------------------------------

    Make sure you edit the file at the top to have the old and new username before you save it.

    Type Cntr-X and save as usernamechange. Do not put an extension on the file.

    Then type ./usernamechange and watch the magic.

    restart apache after changing usernames

    /etc/rc.d/init.d/httpd restart

    -/Steve
     
    #8 spoony, Mar 13, 2003
    Last edited: Mar 24, 2003
  9. wacnstac

    wacnstac Well-Known Member

    Joined:
    Mar 11, 2003
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    6
    A couple days too late for me. I had to manually rebuild one of my accounts.
     
  10. jackal

    jackal Well-Known Member
    PartnerNOC

    Joined:
    Feb 23, 2002
    Messages:
    708
    Likes Received:
    0
    Trophy Points:
    16
    Works Great ! Thanks Nick
     
Loading...

Share This Page