Mounting NFS Directory as Home Directory under /home for Users using PAM.D and PAM_MOUNT

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












Currently I am trying to mount NFS folder as home folder for my users via pam.d and pam_mount. Unfortunately, when I log into my machine I get stuck in spawn.c with following message:



(spawn.c:136): setting uid to user myusername


I configured my system (CentOS 7) as follow:



/etc/pam.d/system-auth



#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth required pam_env.so
auth required pam_faildelay.so delay=2000000
auth sufficient pam_fprintd.so
auth sufficient unix.so nullok try_first_pass
auth optional pam_mount.so
auth requisite pam_succeed_if.so uid >= 1000 quiet_success
auth required pam_deny.so

account required pam_unix.so
account sufficient pam_localuser.so
account sufficient pam_succeed_if.so uid < 1000 quiet
account required pam_permit.so

password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok
password optional pam_mount.so
password requisite pam_pwquality.so try_first_pass local_users_only retry=3 authtok_type=
password required pam_deny.so

session optional pam_keyinit.so revoke
session required pam_limits.so
-session optional pam_systemd.so
session required pam_unix.so
session optional pam_mount.so


/etc/security/pam_mount.conf.xml



<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE pam_mount SYSTEM "pam_mount.conf.xml.dtd">
<pam_mount>
<debug enable="1">
<volume fstype="fuse" path="sshfs#%(USER)@my-server:/my/path" mountpoint="/home/%(USER)" options="nonempty" />
<mntoptions allow="nosuid,nodev,loop,encryption,fsck,nonempty,allow_root,allow_other" />
<mntoptions require="nosuid,nodev" />
<logout wait="0" hup="no" term="no" kill="no" />
<mkmountpoint enable="1! remove="true" />
<fd0ssh>/usr/libexec/hxtools/fd0ssh</fd0ssh>
</pam_mount>


What is odd is if I change the mountpoint in my pam_mount.conf.xml to some where else than the usual home diretcroy e.g:
/etc/security/pam_mount.conf.xml



<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE pam_mount SYSTEM "pam_mount.conf.xml.dtd">
<pam_mount>
<debug enable="1">
<volume fstype="fuse" path="sshfs#%(USER)@my-server:/my/path" mountpoint="/mnt/%(USER)" options="nonempty" />
<mntoptions allow="nosuid,nodev,loop,encryption,fsck,nonempty,allow_root,allow_other" />
<mntoptions require="nosuid,nodev" />
<logout wait="0" hup="no" term="no" kill="no" />
<mkmountpoint enable="1! remove="true" />
<fd0ssh>/usr/libexec/hxtools/fd0ssh</fd0ssh>
</pam_mount>


everything works fine. How does the configuration files need to be adopted so that pam_mount mount the directory directly under home ?










share|improve this question





















  • Have you checked if there is anything in the /home/%(USER) directory the moment after the login hangs?
    – expz
    2 days ago














up vote
0
down vote

favorite












Currently I am trying to mount NFS folder as home folder for my users via pam.d and pam_mount. Unfortunately, when I log into my machine I get stuck in spawn.c with following message:



(spawn.c:136): setting uid to user myusername


I configured my system (CentOS 7) as follow:



/etc/pam.d/system-auth



#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth required pam_env.so
auth required pam_faildelay.so delay=2000000
auth sufficient pam_fprintd.so
auth sufficient unix.so nullok try_first_pass
auth optional pam_mount.so
auth requisite pam_succeed_if.so uid >= 1000 quiet_success
auth required pam_deny.so

account required pam_unix.so
account sufficient pam_localuser.so
account sufficient pam_succeed_if.so uid < 1000 quiet
account required pam_permit.so

password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok
password optional pam_mount.so
password requisite pam_pwquality.so try_first_pass local_users_only retry=3 authtok_type=
password required pam_deny.so

session optional pam_keyinit.so revoke
session required pam_limits.so
-session optional pam_systemd.so
session required pam_unix.so
session optional pam_mount.so


/etc/security/pam_mount.conf.xml



<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE pam_mount SYSTEM "pam_mount.conf.xml.dtd">
<pam_mount>
<debug enable="1">
<volume fstype="fuse" path="sshfs#%(USER)@my-server:/my/path" mountpoint="/home/%(USER)" options="nonempty" />
<mntoptions allow="nosuid,nodev,loop,encryption,fsck,nonempty,allow_root,allow_other" />
<mntoptions require="nosuid,nodev" />
<logout wait="0" hup="no" term="no" kill="no" />
<mkmountpoint enable="1! remove="true" />
<fd0ssh>/usr/libexec/hxtools/fd0ssh</fd0ssh>
</pam_mount>


What is odd is if I change the mountpoint in my pam_mount.conf.xml to some where else than the usual home diretcroy e.g:
/etc/security/pam_mount.conf.xml



<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE pam_mount SYSTEM "pam_mount.conf.xml.dtd">
<pam_mount>
<debug enable="1">
<volume fstype="fuse" path="sshfs#%(USER)@my-server:/my/path" mountpoint="/mnt/%(USER)" options="nonempty" />
<mntoptions allow="nosuid,nodev,loop,encryption,fsck,nonempty,allow_root,allow_other" />
<mntoptions require="nosuid,nodev" />
<logout wait="0" hup="no" term="no" kill="no" />
<mkmountpoint enable="1! remove="true" />
<fd0ssh>/usr/libexec/hxtools/fd0ssh</fd0ssh>
</pam_mount>


everything works fine. How does the configuration files need to be adopted so that pam_mount mount the directory directly under home ?










share|improve this question





















  • Have you checked if there is anything in the /home/%(USER) directory the moment after the login hangs?
    – expz
    2 days ago












up vote
0
down vote

favorite









up vote
0
down vote

favorite











Currently I am trying to mount NFS folder as home folder for my users via pam.d and pam_mount. Unfortunately, when I log into my machine I get stuck in spawn.c with following message:



(spawn.c:136): setting uid to user myusername


I configured my system (CentOS 7) as follow:



/etc/pam.d/system-auth



#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth required pam_env.so
auth required pam_faildelay.so delay=2000000
auth sufficient pam_fprintd.so
auth sufficient unix.so nullok try_first_pass
auth optional pam_mount.so
auth requisite pam_succeed_if.so uid >= 1000 quiet_success
auth required pam_deny.so

account required pam_unix.so
account sufficient pam_localuser.so
account sufficient pam_succeed_if.so uid < 1000 quiet
account required pam_permit.so

password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok
password optional pam_mount.so
password requisite pam_pwquality.so try_first_pass local_users_only retry=3 authtok_type=
password required pam_deny.so

session optional pam_keyinit.so revoke
session required pam_limits.so
-session optional pam_systemd.so
session required pam_unix.so
session optional pam_mount.so


/etc/security/pam_mount.conf.xml



<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE pam_mount SYSTEM "pam_mount.conf.xml.dtd">
<pam_mount>
<debug enable="1">
<volume fstype="fuse" path="sshfs#%(USER)@my-server:/my/path" mountpoint="/home/%(USER)" options="nonempty" />
<mntoptions allow="nosuid,nodev,loop,encryption,fsck,nonempty,allow_root,allow_other" />
<mntoptions require="nosuid,nodev" />
<logout wait="0" hup="no" term="no" kill="no" />
<mkmountpoint enable="1! remove="true" />
<fd0ssh>/usr/libexec/hxtools/fd0ssh</fd0ssh>
</pam_mount>


What is odd is if I change the mountpoint in my pam_mount.conf.xml to some where else than the usual home diretcroy e.g:
/etc/security/pam_mount.conf.xml



<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE pam_mount SYSTEM "pam_mount.conf.xml.dtd">
<pam_mount>
<debug enable="1">
<volume fstype="fuse" path="sshfs#%(USER)@my-server:/my/path" mountpoint="/mnt/%(USER)" options="nonempty" />
<mntoptions allow="nosuid,nodev,loop,encryption,fsck,nonempty,allow_root,allow_other" />
<mntoptions require="nosuid,nodev" />
<logout wait="0" hup="no" term="no" kill="no" />
<mkmountpoint enable="1! remove="true" />
<fd0ssh>/usr/libexec/hxtools/fd0ssh</fd0ssh>
</pam_mount>


everything works fine. How does the configuration files need to be adopted so that pam_mount mount the directory directly under home ?










share|improve this question













Currently I am trying to mount NFS folder as home folder for my users via pam.d and pam_mount. Unfortunately, when I log into my machine I get stuck in spawn.c with following message:



(spawn.c:136): setting uid to user myusername


I configured my system (CentOS 7) as follow:



/etc/pam.d/system-auth



#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth required pam_env.so
auth required pam_faildelay.so delay=2000000
auth sufficient pam_fprintd.so
auth sufficient unix.so nullok try_first_pass
auth optional pam_mount.so
auth requisite pam_succeed_if.so uid >= 1000 quiet_success
auth required pam_deny.so

account required pam_unix.so
account sufficient pam_localuser.so
account sufficient pam_succeed_if.so uid < 1000 quiet
account required pam_permit.so

password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok
password optional pam_mount.so
password requisite pam_pwquality.so try_first_pass local_users_only retry=3 authtok_type=
password required pam_deny.so

session optional pam_keyinit.so revoke
session required pam_limits.so
-session optional pam_systemd.so
session required pam_unix.so
session optional pam_mount.so


/etc/security/pam_mount.conf.xml



<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE pam_mount SYSTEM "pam_mount.conf.xml.dtd">
<pam_mount>
<debug enable="1">
<volume fstype="fuse" path="sshfs#%(USER)@my-server:/my/path" mountpoint="/home/%(USER)" options="nonempty" />
<mntoptions allow="nosuid,nodev,loop,encryption,fsck,nonempty,allow_root,allow_other" />
<mntoptions require="nosuid,nodev" />
<logout wait="0" hup="no" term="no" kill="no" />
<mkmountpoint enable="1! remove="true" />
<fd0ssh>/usr/libexec/hxtools/fd0ssh</fd0ssh>
</pam_mount>


What is odd is if I change the mountpoint in my pam_mount.conf.xml to some where else than the usual home diretcroy e.g:
/etc/security/pam_mount.conf.xml



<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE pam_mount SYSTEM "pam_mount.conf.xml.dtd">
<pam_mount>
<debug enable="1">
<volume fstype="fuse" path="sshfs#%(USER)@my-server:/my/path" mountpoint="/mnt/%(USER)" options="nonempty" />
<mntoptions allow="nosuid,nodev,loop,encryption,fsck,nonempty,allow_root,allow_other" />
<mntoptions require="nosuid,nodev" />
<logout wait="0" hup="no" term="no" kill="no" />
<mkmountpoint enable="1! remove="true" />
<fd0ssh>/usr/libexec/hxtools/fd0ssh</fd0ssh>
</pam_mount>


everything works fine. How does the configuration files need to be adopted so that pam_mount mount the directory directly under home ?







centos nfs pam home automounting






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Sep 27 at 15:00









FranzOS

1




1











  • Have you checked if there is anything in the /home/%(USER) directory the moment after the login hangs?
    – expz
    2 days ago
















  • Have you checked if there is anything in the /home/%(USER) directory the moment after the login hangs?
    – expz
    2 days ago















Have you checked if there is anything in the /home/%(USER) directory the moment after the login hangs?
– expz
2 days ago




Have you checked if there is anything in the /home/%(USER) directory the moment after the login hangs?
– expz
2 days ago















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f471852%2fmounting-nfs-directory-as-home-directory-under-home-for-users-using-pam-d-and-p%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f471852%2fmounting-nfs-directory-as-home-directory-under-home-for-users-using-pam-d-and-p%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay