我有一个连接到LDAP的Fedora Linux服务器,我无法以普通用户的身份login到它。
我仍然可以以root身份login,但即使如此,我也无法创build我的普通用户的主目录。 LDAPconfiguration为自动挂载用户的主目录,但这似乎没有发生。 遗憾的是,mkdir没有给我有用的错误信息。 例如
[myuser@localhost ~]# ssh myuser@otherhost Connection closed by otherhost [myuser@localhost ~]# ssh root@otherhost [root@otherhost ~]# cd /home [root@otherhost home]# ls [root@otherhost home]# mkdir myuser mkdir: cannot create directory `myuser': No such file or directory
什么是造成这个错误?
我怀疑有LDAP的东西已经成熟,这阻止了目录的创build。 不过,我不知道从哪里开始研究,因为我没有看到任何有用的错误消息。
我应该如何调查? 谷歌search创build主目录的问题只给我一百万关于使用mkdir -p条目,这没有帮助。
编辑:otherhost:/ etc / fstab包含以下行,它定义了/ home的挂载点:
/dev/mapper/vg_otherhost-lv_home /home ext4 defaults 1 2
编辑:vgdiplay输出
[root@otherhost ~]# vgdisplay -v Finding all volume groups Finding volume group "vg_otherhost" --- Volume group --- VG Name vg_otherhost System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 4 VG Access read/write VG Status resizable MAX LV 0 Cur LV 3 Open LV 3 Max PV 0 Cur PV 1 Act PV 1 VG Size 149.50 GiB PE Size 32.00 MiB Total PE 4784 Alloc PE / Size 4784 / 149.50 GiB Free PE / Size 0 / 0 VG UUID UnbJdL-v1XY-2HzI-QoHQ-jwtD-0U6N-Nuh66I --- Logical volume --- LV Name /dev/vg_otherhost/lv_root VG Name vg_otherhost LV UUID m1Lp6A-SHqa-V3Of-r8GS-TpE6-R42B-M99DbQ LV Write Access read/write LV Status available # open 1 LV Size 50.00 GiB Current LE 1600 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:0 --- Logical volume --- LV Name /dev/vg_otherhost/lv_home VG Name vg_otherhost LV UUID pqxV47-8QyV-gFpi-xAdn-gfIq-wdV3-rkIeXN LV Write Access read/write LV Status available # open 1 LV Size 93.66 GiB Current LE 2997 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:2 --- Logical volume --- LV Name /dev/vg_otherhost/lv_swap VG Name vg_otherhost LV UUID f4tqzv-cxEh-rlmU-mByY-RdkM-V1Iz-o4gCRv LV Write Access read/write LV Status available # open 1 LV Size 5.84 GiB Current LE 187 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:1 --- Physical volumes --- PV Name /dev/sda2 PV UUID lQDn1b-emBB-b75e-e6kt-KxBu-OheR-mB12Ac PV Status allocatable Total PE / Free PE 4784 / 0
Autofs似乎在运行。
/etc/auto.master的内容:
/misc /etc/auto.misc /net -hosts +auto.master
/etc/auto.misc的内容:
cd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom
/etc/auto.net的内容:
#!/bin/bash key="$1" opts="-fstype=nfs,hard,intr,nodev,nosuid" for P in /bin /sbin /usr/bin /usr/sbin do for M in showmount kshowmount do if [ -x $P/$M ] then SMNT=$P/$M break fi done done [ -x $SMNT ] || exit 1 SHOWMOUNT="$SMNT --no-headers -e $key" $SHOWMOUNT | LC_ALL=C sort -k 1 | \ awk -v key="$key" -v opts="$opts" -- ' BEGIN { ORS=""; first=1 } { if (first) { print opts; first=0 }; print " \\\n\t" $1, key ":" $1 } END { if (!first) print "\n"; else exit 1 } ' | sed 's/#/\\#/g'
/etc/auto.smb的内容:
#!/bin/bash key="$1" opts="-fstype=cifs" for P in /bin /sbin /usr/bin /usr/sbin do if [ -x $P/smbclient ] then SMBCLIENT=$P/smbclient break fi done [ -x $SMBCLIENT ] || exit 1 $SMBCLIENT -gNL $key 2>/dev/null| awk -v key="$key" -v opts="$opts" -F'|' -- ' BEGIN { ORS=""; first=1 } /Disk/ { if (first) print opts; first=0 dir = $2 loc = $2 # Enclose mount dir and location in quotes # Double quote "$" in location as it is special gsub(/\$$/, "\\$", loc); gsub(/\&/,"\\\\&",loc) print " \\\n\t \"/" dir "\"", "\"://" key "/" loc "\"" } END { if (!first) print "\n"; else exit 1 } '
/ etc / sysconfig / autofs的内容:
TIMEOUT=300 BROWSE_MODE="no" MOUNT_NFS_DEFAULT_PROTOCOL=4 USE_MISC_DEVICE="yes"
请包含vgdisplay -v的输出。 如果autofs正在运行( ps -ef | grep automount ),请包含/etc/auto.*和autofsconfiguration文件(通常是/ etc / default / autofs或/ etc / sysconfig / autofs)的内容。
编辑:
这可能是线路
+auto.master
在/etc/auto.master中包含一个来自LDAP(或NIS)的auto.master映射,它将/ home定义为自动安装的目录。 可以肯定的是,您必须检查/etc/nsswitch.conf和autofsconfiguration文件中的automount条目。 如果将nsswitch定义为nis,则需要运行ypcat -k auto.master ; 如果将其定义为ldap,则需要ldapsearch LDAP服务器的相应选项运行ldapsearch 。
为了testing理论,只需从/etc/auto.master注释掉该行并重新启动autofs即可。
自动安装的目录不允许您在顶层创build新的文件或目录,如果您尝试这样做,会给您类似于您所得到的错误。