[ILUG-Cochin.org] how to change login password in user login
Shibin k.reeny
shibinkreeny at gmail.com
Fri Jan 16 20:20:36 IST 2009
Balakrishnan Pillai wrote:
> On Thu, Jan 8, 2009 at 3:49 AM, Shibin k.reeny <shibinkreeny at gmail.com> wrote:
>
>
>> using usermod command we can change the user name that is login name
>> usermod -l newname currentusername
>> but how to change the entire GECOS information like real name,name the home
>> directory,group etc...
>> at command prompt.
>>
>>
>
>
> login name and home directory are not in the GECOS fields of the
> /etc/password file.
>
> chfn command will change the GEFOS fields
> " man chfn " for more information and how to change each field.
> Real name and other GECOS fields can simply be changed, no problem
> use any text editor to do it. BETTER USE chfn comamnd.
>
> to change login name Edit /etc/passwd
> "man 5 passwd" will give more information about the structure of
> /etc/passwd file.
>
> to change the login directory
> 1.. create a directory in /home or anywhere as mentioned in the
> /etc/passwd file (field 6)
> 2. name of the directory should match the login name (field No 1)
> (Directory name can be different, but this will create confusion)
> UID of the directory should match the UID mentioned in the
> /etc/password file (field3)
>
> 3. create a group
> if using debian or ubuntu use the command groupadd
> /etc/group file contains all groups and their GID (field 3)
>
> Change owner and group of the directory to that of the user id (UID)
> mentioned in the /etc/passwd file and groupID (GID) mentioned in the
> /etc/group file (field No 3).
>
>
> Please note that kernel will identify the users by their UID and GID
> of the users and not by their login name.
>
> with regards
> M.Balakrishna Pillai
>
>
> if using debian or ubuntu
> use the command adduser
> adduser loginname:loginname path to the newly created directory
>
> _______________________________________________
> Mailinglist mailing list
> Mailinglist at ilug-cochin.org
> http://ilug-cochin.org/mailman/listinfo/mailinglist_ilug-cochin.org
>
>
first sorry for taking this long to reply.
thanks for the above information it was very useful.
i did add a user called test to do the changes :
username = test
realname = test
step 1 : to change the username(login name)
*usermod -l test1 test*
step 2 :to change the realname
*chfn -f test1 test
*(using chfn we can change the other GECOS information)
step 3: to the password
*
passwd test1
*
step 4 : to change the shell
* chsh -s /bin/sh test1
*step 5: to change the home directory
*
usermod -d /home/test1 test1
mv /home/test/ /home/test1
*step6: to change the user id*
usermod -u 1088 test1
*upto this i could change but i didn't understand howto change the
information(renaming the group & its id) regarding the group that
already exist without removing its existing members.
*
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ilug-cochin.org/pipermail/mailinglist_ilug-cochin.org/attachments/20090116/bfa9d134/attachment.html>
More information about the Mailinglist
mailing list