Results 1 to 10 of 10

Thread: usermod

  1. #1
    Join Date
    Jul 2005
    Beans
    382

    usermod

    Just wanted to post something I'm finding useful, in case it helps.
    I keep the latest LTS and non-LTS Ubuntus on my home desktop. Each distro gets a partition for / on an SSD and shares a common HD for /home
    I keep the same username for both distros, but maintain different /~ directories so I can keep one set of files and symlink from the secondary distro

    The way I do this is to install with a dummy admin account, then immediately create a new account with my name etc, then use the command

    Code:
    usermod -d /home/distro/myname -m myname
    Obviously I have trusty and saucy as 'distro' at the moment.

    HTH
    Registered Linux User #407403

  2. #2
    Join Date
    Sep 2006
    Location
    France.
    Beans
    Hidden!
    Distro
    Ubuntu Mate 15.10 Wily Werewolf

    Re: usermod

    No issue with user configs files?
    I'm not surprised it works, in particular for back to back releases, but I do not think I would advise doing so. It most probably sets grounds for trouble.
    | My old and mostly abandoned blog |
    Linux user #413984 ; Ubuntu user #178
    J'aime les fraises.
    Nighty night me lovelies!

    | Reinstalling Ubuntu ? Please check this bug first ! |
    | Using a ppa ? Please install ppa-purge from universe, you may need it should you want to revert packages back |
    | No support requests / username changes by PM, thanks. |

  3. #3
    Join Date
    Jul 2005
    Beans
    382

    Re: usermod

    No, in fact the idea was to avoid config file problems.
    I would agree that sharing a home directory between distros is a very bad idea, this was a way to avoid that whilst keeping the same username between distros and hence avoiding permissions problems.
    Each distro gets its own home directory: trusty looks for /home/trusty/myname and saucy looks for /home/saucy/myname. I could have set up separate partitions with a dedicated /home for each, but this seemed like a neater way.
    Registered Linux User #407403

  4. #4
    Join Date
    Sep 2006
    Location
    France.
    Beans
    Hidden!
    Distro
    Ubuntu Mate 15.10 Wily Werewolf

    Re: usermod

    OK, I read your OP too quickly, sorry. Do the two users with the same username have the same userid or not ?
    | My old and mostly abandoned blog |
    Linux user #413984 ; Ubuntu user #178
    J'aime les fraises.
    Nighty night me lovelies!

    | Reinstalling Ubuntu ? Please check this bug first ! |
    | Using a ppa ? Please install ppa-purge from universe, you may need it should you want to revert packages back |
    | No support requests / username changes by PM, thanks. |

  5. #5
    Join Date
    Jul 2005
    Beans
    382

    Re: usermod

    Yes. Same permissions, same ID everything.
    Registered Linux User #407403

  6. #6
    Join Date
    Sep 2006
    Location
    France.
    Beans
    Hidden!
    Distro
    Ubuntu Mate 15.10 Wily Werewolf

    Re: usermod

    Well, as the / and /home are different, I guess it can work. If it is a matter of sharing files, why not using an exchange partition ? This is what I routinely do here, I have 2 storage partitions that different users access. / and /home are kept at minimal viable sizes, everything else is on these 2 other partitions. I do not format them over when I run fresh installs.
    | My old and mostly abandoned blog |
    Linux user #413984 ; Ubuntu user #178
    J'aime les fraises.
    Nighty night me lovelies!

    | Reinstalling Ubuntu ? Please check this bug first ! |
    | Using a ppa ? Please install ppa-purge from universe, you may need it should you want to revert packages back |
    | No support requests / username changes by PM, thanks. |

  7. #7
    Join Date
    Oct 2008
    Location
    ExodusHair<Čubura
    Beans
    4,421
    Distro
    Ubuntu Development Release

    Re: usermod

    Because OPs I post is not about exchangeing the files but good and clever bookkeeping practice... Carefull reading of I OPs post reveals almost everything needed...
    Last edited by zika; March 23rd, 2014 at 07:59 PM.

  8. #8
    Join Date
    Sep 2006
    Location
    France.
    Beans
    Hidden!
    Distro
    Ubuntu Mate 15.10 Wily Werewolf

    Re: usermod

    Quote Originally Posted by zika View Post
    Because in OPs post is not about exchangeing the files but good and tidy bookkeeping practice... Carefull reading of I OPs post reveals almost everything needed...
    Yes, that is true (and I did read too quickly). Now, unless I am the only one to extrapolate and misread, I just wanted to point that out for other readers.
    | My old and mostly abandoned blog |
    Linux user #413984 ; Ubuntu user #178
    J'aime les fraises.
    Nighty night me lovelies!

    | Reinstalling Ubuntu ? Please check this bug first ! |
    | Using a ppa ? Please install ppa-purge from universe, you may need it should you want to revert packages back |
    | No support requests / username changes by PM, thanks. |

  9. #9
    Join Date
    Jul 2005
    Beans
    382

    Re: usermod

    In fact bapoumba's setup is just as valid as mine, probably more so in most cases, and I did consider doing it that way first.
    My intention is to keep 14.04 as production and to install each new non-LTS to play with, so I know my /home/trusty will be on the machine until 16.04 at least, so I can keep all media there and symlink from the other distro. I also keep all the older distro /home/distro diretories without needing separate partitions for each, which starts to get messy.
    Registered Linux User #407403

  10. #10
    Join Date
    Sep 2006
    Location
    France.
    Beans
    Hidden!
    Distro
    Ubuntu Mate 15.10 Wily Werewolf

    Re: usermod

    Thanks for the explanation pauljwells
    | My old and mostly abandoned blog |
    Linux user #413984 ; Ubuntu user #178
    J'aime les fraises.
    Nighty night me lovelies!

    | Reinstalling Ubuntu ? Please check this bug first ! |
    | Using a ppa ? Please install ppa-purge from universe, you may need it should you want to revert packages back |
    | No support requests / username changes by PM, thanks. |

Bookmarks

Posting Permissions

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