We help IT Professionals succeed at work.

change home login

Jasmin shahrzad
Jasmin shahrzad used Ask the Experts™
on
in centos 8, how to change user login home to customer login?
 i mean somthing like that /home/company/
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
i login add user from ipa (then its not a centos local user) IN IPA I ADD USER LOGIN TO /home/company/user-name
but when i try to login as user :
su: warning: cannot change directory to /home/COMPAY-NAME/USER-NAME: No such file or directory
David FavorFractional CTO
Distinguished Expert 2018

Commented:
Easy way to do this.

1) Create the new home directory.

2) Ensure correct ownership + permissions set on new home directory.

3) Edit /etc/passwd (using the vipw command) to manually set the net home directory.

Note: Best this user be logged out when doing this, to avoid odd behavior.

Author

Commented:
No David.
This is not i Mean.
I have a ipa_free server install on centos 8. When i Create user from GUI i change Home Directory to home/company/username.
Company folder is exist under Home and have a permission 775.
I can see Ask for user on server with getend and I can su to user.
Then i get error  company_name not such a file or Directory
David FavorFractional CTO
Distinguished Expert 2018

Commented:
I think the clue here might be company_name which seems related to IPA (maybe) rather than actual Linux level user data.

Author

Commented:
According to doc at the end should say :
Ipa config-mod -- defaultshell=/bin/bash
Then it return
....
....
Home Directory base: /home
...
....
nociSoftware Engineer
Distinguished Expert 2018

Commented:
If the basename is /home then   home/company.user  probably is  /home/home/company/user....

You probably need to stick to either absolute pathnames (starting with /) or modyfy the default to  /home/companyname and tack on the default username, or use companyname/username  for each user (might be handy with multi-tennants setup).
i need to install ipa mkhomedir and enable it. Then i can create user in ipa and ipa create home directories for user.