LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   After domain change Could not chdir to home directory (https://www.linuxquestions.org/questions/linux-general-1/after-domain-change-could-not-chdir-to-home-directory-4175694369/)

Imtiaz Deen 04-27-2021 03:11 PM

After domain change Could not chdir to home directory
 
I am getting this error "Could not chdir to home directory /home/user: No such file or directory" after unjoin domain using sssd and rejoining using samba-winbind

TB0ne 04-27-2021 03:19 PM

Quote:

Originally Posted by Imtiaz Deen (Post 6245626)
I am getting this error "Could not chdir to home directory /home/user: No such file or directory" after unjoin domain using sssd and rejoining using samba-winbind

Ok; so based on what you posted, what do you think we can tell you? You don't tell us anything about your system, how its configured, version/distro of Linux, what you did (and are TRYING to do), etc.

Short answer: rejoin the domain
Longer answer: provide actual details, read the "Question Guidelines" link in my posting signature, and we can try to help you.

Imtiaz Deen 04-27-2021 03:34 PM

Sorry for not sharing expected details.

I am using CentOS Linux release 7.8.2003 (Core)


smb.conf:

[global]
workgroup = DEV
realm = DEV.DEEN.LOCAL
security = ads
idmap config * : range = 16777216-33554431
template homedir = /home/%U
template shell = /bin/bash
kerberos method = secrets and keytab
winbind use default domain = true
winbind offline logon = false

#--authconfig--end-line--

log file = /var/log/samba/log.%m
idmap config * : rangesize = 1000000
load printers = no
;idmap config * : range = 1000000-19999999
passdb backend = tdbsam
netbios name = DEVDEENV01
cups options = raw
server string = VXSP TDH DB SERVER 2
idmap config * : backend = autorid
encrypt passwords = yes
os level = 20
max log size = 50


SSH output:

login as: deen\user1
Using keyboard-interactive authentication.
Password:
Last login: Tue Apr 27 12:42:54 2021 from 10.80.200.20
Could not chdir to home directory /home/user1: No such file or directory
-bash-4.2$

TB0ne 04-27-2021 05:07 PM

Quote:

Originally Posted by Imtiaz Deen (Post 6245635)
Sorry for not sharing expected details. I am using CentOS Linux release 7.8.2003 (Core)
smb.conf:
Code:

[global]
  workgroup = DEV
  realm = DEV.DEEN.LOCAL
  security = ads
  idmap config * : range = 16777216-33554431
  template homedir = /home/%U
  template shell = /bin/bash
  kerberos method = secrets and keytab
  winbind use default domain = true
  winbind offline logon = false

#--authconfig--end-line--

        log file = /var/log/samba/log.%m
        idmap config * : rangesize = 1000000
        load printers = no
        ;idmap config * : range = 1000000-19999999
        passdb backend = tdbsam
        netbios name = DEVDEENV01
        cups options = raw
        server string = VXSP TDH DB SERVER 2
        idmap config * : backend = autorid
        encrypt passwords = yes
        os level = 20
        max log size = 50

SSH output:
Code:

login as: deen\user1
Using keyboard-interactive authentication.
Password:
Last login: Tue Apr 27 12:42:54 2021 from 10.80.200.20
Could not chdir to home directory /home/user1: No such file or directory
-bash-4.2$


Again, you're still not providing relevant information, such as WHY you disconnected from the AD server, what you're trying to do, or what you did/have done so far.

Who configured Samba and Active Directory? Because you may want to ask them for assistance...did you look at what you posted? Have you checked the Samba log files? Because based on what you posted, your home directory is on an active directory server....very obviously, if you're not CONNECTED to the server, you can't map a drive, can you?

Imtiaz Deen 04-29-2021 02:49 PM

I am able to resolve this issue by using following commands.


cp -R /etc/skel/ /home/user1

cd /home/user1/skel

ls -lah

cp .* ../

cd ..

rm -rf skel/

chown -R "deen\user1"."deen\user1" /home/user1

ls -lah (you should see output like below)

total 24K
drwxr-xr-x 2 deen\user1 deen\user1 4.0K Apr 28 12:56 .
drwxr-xr-x. 44 root root 4.0K Apr 28 12:49 ..
-rw-r--r-- 1 deen\user1 deen\user1 18 Apr 28 12:55 .bash_logout
-rw-r--r-- 1 deen\user1 deen\user1 193 Apr 28 12:55 .bash_profile
-rw-r--r-- 1 deen\user1 deen\user1 344 Apr 28 12:55 .bashrc
-rw-r--r-- 1 deen\user1 deen\user1 172 Apr 28 12:55 .kshrc


SSH output

login as: deen\user1
Using keyboard-interactive authentication.
Password:
Last login: Tue Apr 28 15:36:48 2021 from 10.X.X.X

deen\user1 @ DEVDEENV01 | ~
-->

TB0ne 04-30-2021 09:07 AM

Quote:

Originally Posted by Imtiaz Deen (Post 6246308)
I am able to resolve this issue by using following commands.
Code:

cp -R /etc/skel/ /home/user1
cd /home/user1/skel
ls -lah
cp .* ../
cd ..
rm -rf skel/
chown -R "deen\user1"."deen\user1" /home/user1
ls -lah (you should see output like below)

total 24K
drwxr-xr-x  2 deen\user1 deen\user1 4.0K Apr 28 12:56 .
drwxr-xr-x. 44 root          root    4.0K Apr 28 12:49 ..
-rw-r--r--  1 deen\user1 deen\user1  18 Apr 28 12:55 .bash_logout
-rw-r--r--  1 deen\user1 deen\user1  193 Apr 28 12:55 .bash_profile
-rw-r--r--  1 deen\user1 deen\user1  344 Apr 28 12:55 .bashrc
-rw-r--r--  1 deen\user1 deen\user1  172 Apr 28 12:55 .kshrc

SSH output
Code:

login as: deen\user1
Using keyboard-interactive authentication.
Password:
Last login: Tue Apr 28 15:36:48 2021 from 10.X.X.X

deen\user1 @ DEVDEENV01 | ~


So you CREATED the directory you didn't have, but that certainly DOES NOT solve the issue. None of the other files (or users) are going to have their data either.

You still haven't said what you are/were trying to accomplish by disconnecting from the AD, but all you did was create yourself a home directory. Yes, that will make the missing directory message go away, but you don't have ANY other data.


All times are GMT -5. The time now is 12:50 AM.