2,102 bytes added
, 18:34, 25 March 2020
{{Languages|AddExtraHardDisk}}
{{Level|Advanced}}
{{usefulnote}}
== Description ==
Modify the name of a an existing useraccount in SME
{{Warning box|'''This is NOT comprehensive''' and other action may be required}}
===Commands===
Install phpldapadmin - it will make life a lot easier.
https://wiki.contribs.org/Phpldapadmin
Login with phpldapadmin
Go to Users and select the user you wish to rename
At the bottom of the page change the UserName to the new name and save
Next change the email address in calFBURL and Email and the name of the home directory
Go to Groups
Select the cn and then rename it
====CLI====
In a terminal do the following:
Remove the samba user
smbpasswd -x user.old
Use vipw and vigr to edit passwd and groups
Change the username
vipw
Change the shadow file
vipw -s
Change the group
vipg
Change the shadow file
vipg -s
Move the users home directory
mv /home/e-smith/files/users/user.old /home/e-smith/files/users/user.new
Carefully edit
/home/e-smith/db/accounts
Also expand:
expand-template /etc/e-smith/pam/accounts.allow
expand-template /etc/e-smith/pam/accounts.deny
expand-template /etc/e-smith/pam/users.allow
Add a new user name in samba. Set the password the same as the uix password
smbpasswd add -a user
signal-event console-save
In server manager change/remove pseudonyms
You should be able to test samba with
smbclient -L ip_of_net_interface -U your_user_name
===Notes/ToDo===
If you have issues with the samba user and uid
https://access.redhat.com/solutions/898103 (account required to view)
In /etc/passwd change the user name to match /etc/samba/smbpasswd user name
No remove the old user
smbpasswd -x user.old
In /etc/passwd change the user name back to the new name
Add a new user
smbpasswd add -a user
Set a password and then synchronise the accounts
signal-event user-modify user
===LazyAdminTool===
There may be a method with the LAT tool but this has not been tested.
Backup.
Change username and restore.
Play with the files of the user
----
[[Category:Howto]]
[[Category:Administration:Users]]