Changing the user name
Ralf Friedl
Ralf.Friedl at online.de
Wed May 14 06:40:02 UTC 2014
Laszlo Papp wrote:
> On Wed, May 14, 2014 at 7:28 AM, Ralf Friedl <Ralf.Friedl at online.de> wrote:
>> Laszlo Papp wrote:
>>> is this possible? I am looking for something like "usermod -l" on desktop.
>>>
>>> Alternatively, I have to look into the get/setpwent syscalls?
>> You can also use sed to change /etc/passwd
>>
>> sed -i -e /s^olduser:/newuser:/ /etc/passwd
> Yeah, plus I need to move (i.e. rename) the home folder and then I
> think I am done. Thanks.
You should note that usermod doesn't do that anyway:
-l, --login NEW_LOGIN
The name of the user will be changed from LOGIN to
NEW_LOGIN. Nothing else is changed. In particular, the user's home
directory or mail spool should probably be renamed manually to reflect
the new login name.
More information about the busybox
mailing list