Find the answer to your Linux question:
Results 1 to 3 of 3
hi Everyone, i am quite new to Linux, so please i need some help in fixing this issue. i need to move a user's directory to point to a different ...
  1. #1
    Just Joined!
    Join Date
    Feb 2007
    Posts
    1

    Move /home directory of a user to point at a different directory

    hi Everyone,

    i am quite new to Linux, so please i need some help in fixing this issue.
    i need to move a user's directory to point to a different one rather tha for example /home/user1.
    How can i do that?
    i have tried to edit the /etc/passwd file changing trhe path there but not luck. is there anythihng more i need to do?
    Please note the under the user1 directory there is a lot of info that i do not want to lose....


    Thank you guys.


    Ras2007

  2. #2
    Linux Guru gogalthorp's Avatar
    Join Date
    Oct 2006
    Location
    West (by God) Virginia
    Posts
    3,105
    Not sure what your trying to do.

    I assume you want to move the data from user1 to user2???

    as root just copy the wanted files/directories to the new /home/user1 directory to /home/user2

    then you must change the ownership of the files from user1 to user2

    This can be done graphicly by opening a Super user mode window

    go to System-File Manager-File Manger (superuser mode)

    You can change multiple files by selecting groups the right click and change the owner.

    You can also copy the files this way as root.

  3. #3
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    hi ras2007,

    Welcome to the LinuxForums.

    Quote Originally Posted by ras2007
    i am quite new to Linux, so please i need some help in fixing this issue.
    i need to move a user's directory to point to a different one rather tha for example /home/user1.
    How can i do that?
    i have tried to edit the /etc/passwd file changing trhe path there but not luck. is there anythihng more i need to do?
    Please note the under the user1 directory there is a lot of info that i do not want to lose....
    'cd' to existing home folder and excute this
    Code:
    find . -depth -print0 | cpio --null --sparse -pvd  <path_of_new_home_folder>
    assign new home to user through User & Groups Management in YAST.







    Casper
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...