vsftpd - PAM - MySQL and pam_mkhomedir to create directories Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Come Celebrate our 10 Year Anniversary!vsftpd freezes after failed pam_script authenticationUsing PAM and vsftpd without root accessvsftpd virtual users home directories with pam-mysqlFTP not showing files or directoriesVsFTPd - pam_mkhomedirIssues with VSFTPD / FTP on Linux Ubuntu server - Steps for Troubleshooting?vsftpd not starting on EC2Vsftpd access over wanVSFTPD seems to ignore the configuration settingsIssues editing files using vsftpdConfiguring Lightsail bitnami vsftpd passive

porting install scripts : can rpm replace apt?

51k Euros annually for a family of 4 in Berlin: Is it enough?

Why do we bend a book to keep it straight?

Withdrew £2800, but only £2000 shows as withdrawn on online banking; what are my obligations?

How does debian/ubuntu knows a package has a updated version

Is there a (better) way to access $wpdb results?

Why was the term "discrete" used in discrete logarithm?

How to find all the available tools in mac terminal?

3 doors, three guards, one stone

How to align text above triangle figure

Why are Kinder Surprise Eggs illegal in the USA?

Why light coming from distant stars is not discreet?

How does the particle を relate to the verb 行く in the structure「A を + B に行く」?

What exactly is a "Meth" in Altered Carbon?

What is Arya's weapon design?

Identify plant with long narrow paired leaves and reddish stems

What's the meaning of 間時肆拾貳 at a car parking sign

How to deal with a team lead who never gives me credit?

Why did the IBM 650 use bi-quinary?

List *all* the tuples!

ListPlot join points by nearest neighbor rather than order

What does this icon in iOS Stardew Valley mean?

Resolving to minmaj7

Sci-Fi book where patients in a coma ward all live in a subconscious world linked together



vsftpd - PAM - MySQL and pam_mkhomedir to create directories



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Come Celebrate our 10 Year Anniversary!vsftpd freezes after failed pam_script authenticationUsing PAM and vsftpd without root accessvsftpd virtual users home directories with pam-mysqlFTP not showing files or directoriesVsFTPd - pam_mkhomedirIssues with VSFTPD / FTP on Linux Ubuntu server - Steps for Troubleshooting?vsftpd not starting on EC2Vsftpd access over wanVSFTPD seems to ignore the configuration settingsIssues editing files using vsftpdConfiguring Lightsail bitnami vsftpd passive



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








11















I've been successfully using vsftpd with virtual users connecting with PAM to my mysql DB. Now I'd like to automate creation of user directories with successful vsftpd connection.



Here is /etc/pam.d/vsftpd configuration:



#%PAM-1.0
session optional pam_keyinit.so force revoke
auth required pam_mysql.so verbose=1 user=root passwd=mypass host=localhost db=mydb table=mytable usercolumn=username passwdcolumn=password crypt=3
account required pam_mysql.so verbose=1 user=root passwd=mypass host=localhost db=mydb table=mytable usercolumn=username passwdcolumn=password crypt=3
session required pam_mkhomedir.so skel=/home/skel/ umask=0022 debug


Adding pam_mkhomedir now just shows it can't create the directory with no other messages in any log. So it obviously is not applying. Is there anything else I need?



My /etc/vsftpd/vsftpd.conf:



# No ANONYMOUS users allowed
anonymous_enable=NO
# Allow 'local' users with WRITE permissions (0755)
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=NO
xferlog_enable=YES
connect_from_port_20=YES

# define a unique user on your system which the
# ftp server can use as a totally isolated and unprivileged user.
nopriv_user=vsftpd
chroot_local_user=YES
listen=YES

# here we use the authentication module for vsftpd to check users name and passw
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
userlist_deny=YES
# here the vsftpd will allow the 'vsftpd' user to login into '/home/vsftpd/$USER directory
guest_enable=YES
guest_username=vsftpd
local_root=/home/vsftpd/$USER
user_sub_token=$USER
virtual_use_local_privs=YES
download_enable=NO

force_local_data_ssl=NO
force_local_logins_ssl=NO

# PASV - passive ports for FTP
pasv_enable=YES
pasv_min_port=14000
pasv_max_port=14100


I saw a post saying I need this in my vsftpd.conf so I tried this as well:



session_support=YES


But now it doesn't seem to authenticate anymore as the logs show:



Mar 24 00:46:16 ip-10-212-239-40 vsftpd[1962]: pam_keyinit(vsftpd:session): Unable to look up user "user1"
Mar 24 00:46:16 ip-10-212-239-40 vsftpd[1962]: pam_mkhomedir(vsftpd:session): User unknown.


This is even if I've created the directory already. Now no one can get in.



Any ideas?










share|improve this question
























  • Hi, were you ever able to resolve this issue?

    – George
    Jan 29 '15 at 19:21











  • @George Not at all.

    – Tom
    Feb 2 '15 at 17:36











  • I resolved the issue in a very different way, I moved away from vsftpd and went with pureftp. Setup and running in a couple hours without all these issues. Works perfectly.

    – George
    Feb 2 '15 at 17:38











  • is /home/vsftpd owned by vsftpd?

    – Luca Gibelli
    May 7 '18 at 8:22

















11















I've been successfully using vsftpd with virtual users connecting with PAM to my mysql DB. Now I'd like to automate creation of user directories with successful vsftpd connection.



Here is /etc/pam.d/vsftpd configuration:



#%PAM-1.0
session optional pam_keyinit.so force revoke
auth required pam_mysql.so verbose=1 user=root passwd=mypass host=localhost db=mydb table=mytable usercolumn=username passwdcolumn=password crypt=3
account required pam_mysql.so verbose=1 user=root passwd=mypass host=localhost db=mydb table=mytable usercolumn=username passwdcolumn=password crypt=3
session required pam_mkhomedir.so skel=/home/skel/ umask=0022 debug


Adding pam_mkhomedir now just shows it can't create the directory with no other messages in any log. So it obviously is not applying. Is there anything else I need?



My /etc/vsftpd/vsftpd.conf:



# No ANONYMOUS users allowed
anonymous_enable=NO
# Allow 'local' users with WRITE permissions (0755)
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=NO
xferlog_enable=YES
connect_from_port_20=YES

# define a unique user on your system which the
# ftp server can use as a totally isolated and unprivileged user.
nopriv_user=vsftpd
chroot_local_user=YES
listen=YES

# here we use the authentication module for vsftpd to check users name and passw
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
userlist_deny=YES
# here the vsftpd will allow the 'vsftpd' user to login into '/home/vsftpd/$USER directory
guest_enable=YES
guest_username=vsftpd
local_root=/home/vsftpd/$USER
user_sub_token=$USER
virtual_use_local_privs=YES
download_enable=NO

force_local_data_ssl=NO
force_local_logins_ssl=NO

# PASV - passive ports for FTP
pasv_enable=YES
pasv_min_port=14000
pasv_max_port=14100


I saw a post saying I need this in my vsftpd.conf so I tried this as well:



session_support=YES


But now it doesn't seem to authenticate anymore as the logs show:



Mar 24 00:46:16 ip-10-212-239-40 vsftpd[1962]: pam_keyinit(vsftpd:session): Unable to look up user "user1"
Mar 24 00:46:16 ip-10-212-239-40 vsftpd[1962]: pam_mkhomedir(vsftpd:session): User unknown.


This is even if I've created the directory already. Now no one can get in.



Any ideas?










share|improve this question
























  • Hi, were you ever able to resolve this issue?

    – George
    Jan 29 '15 at 19:21











  • @George Not at all.

    – Tom
    Feb 2 '15 at 17:36











  • I resolved the issue in a very different way, I moved away from vsftpd and went with pureftp. Setup and running in a couple hours without all these issues. Works perfectly.

    – George
    Feb 2 '15 at 17:38











  • is /home/vsftpd owned by vsftpd?

    – Luca Gibelli
    May 7 '18 at 8:22













11












11








11


1






I've been successfully using vsftpd with virtual users connecting with PAM to my mysql DB. Now I'd like to automate creation of user directories with successful vsftpd connection.



Here is /etc/pam.d/vsftpd configuration:



#%PAM-1.0
session optional pam_keyinit.so force revoke
auth required pam_mysql.so verbose=1 user=root passwd=mypass host=localhost db=mydb table=mytable usercolumn=username passwdcolumn=password crypt=3
account required pam_mysql.so verbose=1 user=root passwd=mypass host=localhost db=mydb table=mytable usercolumn=username passwdcolumn=password crypt=3
session required pam_mkhomedir.so skel=/home/skel/ umask=0022 debug


Adding pam_mkhomedir now just shows it can't create the directory with no other messages in any log. So it obviously is not applying. Is there anything else I need?



My /etc/vsftpd/vsftpd.conf:



# No ANONYMOUS users allowed
anonymous_enable=NO
# Allow 'local' users with WRITE permissions (0755)
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=NO
xferlog_enable=YES
connect_from_port_20=YES

# define a unique user on your system which the
# ftp server can use as a totally isolated and unprivileged user.
nopriv_user=vsftpd
chroot_local_user=YES
listen=YES

# here we use the authentication module for vsftpd to check users name and passw
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
userlist_deny=YES
# here the vsftpd will allow the 'vsftpd' user to login into '/home/vsftpd/$USER directory
guest_enable=YES
guest_username=vsftpd
local_root=/home/vsftpd/$USER
user_sub_token=$USER
virtual_use_local_privs=YES
download_enable=NO

force_local_data_ssl=NO
force_local_logins_ssl=NO

# PASV - passive ports for FTP
pasv_enable=YES
pasv_min_port=14000
pasv_max_port=14100


I saw a post saying I need this in my vsftpd.conf so I tried this as well:



session_support=YES


But now it doesn't seem to authenticate anymore as the logs show:



Mar 24 00:46:16 ip-10-212-239-40 vsftpd[1962]: pam_keyinit(vsftpd:session): Unable to look up user "user1"
Mar 24 00:46:16 ip-10-212-239-40 vsftpd[1962]: pam_mkhomedir(vsftpd:session): User unknown.


This is even if I've created the directory already. Now no one can get in.



Any ideas?










share|improve this question
















I've been successfully using vsftpd with virtual users connecting with PAM to my mysql DB. Now I'd like to automate creation of user directories with successful vsftpd connection.



Here is /etc/pam.d/vsftpd configuration:



#%PAM-1.0
session optional pam_keyinit.so force revoke
auth required pam_mysql.so verbose=1 user=root passwd=mypass host=localhost db=mydb table=mytable usercolumn=username passwdcolumn=password crypt=3
account required pam_mysql.so verbose=1 user=root passwd=mypass host=localhost db=mydb table=mytable usercolumn=username passwdcolumn=password crypt=3
session required pam_mkhomedir.so skel=/home/skel/ umask=0022 debug


Adding pam_mkhomedir now just shows it can't create the directory with no other messages in any log. So it obviously is not applying. Is there anything else I need?



My /etc/vsftpd/vsftpd.conf:



# No ANONYMOUS users allowed
anonymous_enable=NO
# Allow 'local' users with WRITE permissions (0755)
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=NO
xferlog_enable=YES
connect_from_port_20=YES

# define a unique user on your system which the
# ftp server can use as a totally isolated and unprivileged user.
nopriv_user=vsftpd
chroot_local_user=YES
listen=YES

# here we use the authentication module for vsftpd to check users name and passw
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
userlist_deny=YES
# here the vsftpd will allow the 'vsftpd' user to login into '/home/vsftpd/$USER directory
guest_enable=YES
guest_username=vsftpd
local_root=/home/vsftpd/$USER
user_sub_token=$USER
virtual_use_local_privs=YES
download_enable=NO

force_local_data_ssl=NO
force_local_logins_ssl=NO

# PASV - passive ports for FTP
pasv_enable=YES
pasv_min_port=14000
pasv_max_port=14100


I saw a post saying I need this in my vsftpd.conf so I tried this as well:



session_support=YES


But now it doesn't seem to authenticate anymore as the logs show:



Mar 24 00:46:16 ip-10-212-239-40 vsftpd[1962]: pam_keyinit(vsftpd:session): Unable to look up user "user1"
Mar 24 00:46:16 ip-10-212-239-40 vsftpd[1962]: pam_mkhomedir(vsftpd:session): User unknown.


This is even if I've created the directory already. Now no one can get in.



Any ideas?







mysql permissions ftp pam vsftpd






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 31 '16 at 20:31









Castaglia

2,60431236




2,60431236










asked Mar 24 '13 at 1:21









TomTom

8311




8311












  • Hi, were you ever able to resolve this issue?

    – George
    Jan 29 '15 at 19:21











  • @George Not at all.

    – Tom
    Feb 2 '15 at 17:36











  • I resolved the issue in a very different way, I moved away from vsftpd and went with pureftp. Setup and running in a couple hours without all these issues. Works perfectly.

    – George
    Feb 2 '15 at 17:38











  • is /home/vsftpd owned by vsftpd?

    – Luca Gibelli
    May 7 '18 at 8:22

















  • Hi, were you ever able to resolve this issue?

    – George
    Jan 29 '15 at 19:21











  • @George Not at all.

    – Tom
    Feb 2 '15 at 17:36











  • I resolved the issue in a very different way, I moved away from vsftpd and went with pureftp. Setup and running in a couple hours without all these issues. Works perfectly.

    – George
    Feb 2 '15 at 17:38











  • is /home/vsftpd owned by vsftpd?

    – Luca Gibelli
    May 7 '18 at 8:22
















Hi, were you ever able to resolve this issue?

– George
Jan 29 '15 at 19:21





Hi, were you ever able to resolve this issue?

– George
Jan 29 '15 at 19:21













@George Not at all.

– Tom
Feb 2 '15 at 17:36





@George Not at all.

– Tom
Feb 2 '15 at 17:36













I resolved the issue in a very different way, I moved away from vsftpd and went with pureftp. Setup and running in a couple hours without all these issues. Works perfectly.

– George
Feb 2 '15 at 17:38





I resolved the issue in a very different way, I moved away from vsftpd and went with pureftp. Setup and running in a couple hours without all these issues. Works perfectly.

– George
Feb 2 '15 at 17:38













is /home/vsftpd owned by vsftpd?

– Luca Gibelli
May 7 '18 at 8:22





is /home/vsftpd owned by vsftpd?

– Luca Gibelli
May 7 '18 at 8:22










2 Answers
2






active

oldest

votes


















0














For user lookups by PAM module to succeed, you need to enable NSS module for MySQL in nsswitch.conf(5). nss_mysql is your friend.






share|improve this answer























  • Any references you can provide on this? I can't seem to find anything about needing nss-mysql in my context?

    – Tom
    Mar 24 '13 at 16:52











  • How is pam_mkhomedir going to figure out the path to the home directory of the user it's supposed to create ? How does it know which database to use for resolving the user ? NSS provides it with that information. In your case, you'll be needing nss_mysql, assuming your user database is stored in a MySQL database.

    – abbe
    Mar 24 '13 at 17:10











  • I'm just trying to find out anything about this library. The link you provided is a very old project with no documentation. If I do install this it gives no indication on what to put in your nssswitch.conf. Only that it may contain 3 parameters. Can you provide any kind of guidance? It does sound like pam_mysql is the same thing as nss-mysql? I do have pam_mysql working where it uses the mysql db to authenticate with vsftpd virtual users.

    – Tom
    Mar 24 '13 at 17:58












  • PAM is not same as NSS. PAM is targeted towards authentication, whereas NSS' objective is to resolve names (hostnames, usernames, etc.). Most of the distros provide a package for nss_mysql, e.g. Debian and derivatives provide it as libnss-mysql. And, yes it's not updated for half-a-decade, but it works fine. Once you install the module, configure it, and add it to your nsswitch.conf(5), things will start working for you.

    – abbe
    Mar 24 '13 at 18:13











  • I added libnss-mysql from my distro. Tried out of the box and nothing is working. Any ideas on what I need to change in nsswitch.conf?

    – Tom
    Mar 24 '13 at 18:53


















0














You could try using pam_script - it's a pam module that allows executing arbitrary shell scripts after a user session is opened (among others).



You can find pam_script here: https://github.com/jeroennijhof/pam_script. It should also be installable via package managers, at least I've been able to install it through apt-get.



Be careful, as vsftpd seems to have some problems with pam_script at least when it denies authentication, see my unresolved question: vsftpd freezes after failed pam_script authentication. However in your case it should not be a problem.






share|improve this answer

























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "2"
    ;
    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',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f490840%2fvsftpd-pam-mysql-and-pam-mkhomedir-to-create-directories%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    For user lookups by PAM module to succeed, you need to enable NSS module for MySQL in nsswitch.conf(5). nss_mysql is your friend.






    share|improve this answer























    • Any references you can provide on this? I can't seem to find anything about needing nss-mysql in my context?

      – Tom
      Mar 24 '13 at 16:52











    • How is pam_mkhomedir going to figure out the path to the home directory of the user it's supposed to create ? How does it know which database to use for resolving the user ? NSS provides it with that information. In your case, you'll be needing nss_mysql, assuming your user database is stored in a MySQL database.

      – abbe
      Mar 24 '13 at 17:10











    • I'm just trying to find out anything about this library. The link you provided is a very old project with no documentation. If I do install this it gives no indication on what to put in your nssswitch.conf. Only that it may contain 3 parameters. Can you provide any kind of guidance? It does sound like pam_mysql is the same thing as nss-mysql? I do have pam_mysql working where it uses the mysql db to authenticate with vsftpd virtual users.

      – Tom
      Mar 24 '13 at 17:58












    • PAM is not same as NSS. PAM is targeted towards authentication, whereas NSS' objective is to resolve names (hostnames, usernames, etc.). Most of the distros provide a package for nss_mysql, e.g. Debian and derivatives provide it as libnss-mysql. And, yes it's not updated for half-a-decade, but it works fine. Once you install the module, configure it, and add it to your nsswitch.conf(5), things will start working for you.

      – abbe
      Mar 24 '13 at 18:13











    • I added libnss-mysql from my distro. Tried out of the box and nothing is working. Any ideas on what I need to change in nsswitch.conf?

      – Tom
      Mar 24 '13 at 18:53















    0














    For user lookups by PAM module to succeed, you need to enable NSS module for MySQL in nsswitch.conf(5). nss_mysql is your friend.






    share|improve this answer























    • Any references you can provide on this? I can't seem to find anything about needing nss-mysql in my context?

      – Tom
      Mar 24 '13 at 16:52











    • How is pam_mkhomedir going to figure out the path to the home directory of the user it's supposed to create ? How does it know which database to use for resolving the user ? NSS provides it with that information. In your case, you'll be needing nss_mysql, assuming your user database is stored in a MySQL database.

      – abbe
      Mar 24 '13 at 17:10











    • I'm just trying to find out anything about this library. The link you provided is a very old project with no documentation. If I do install this it gives no indication on what to put in your nssswitch.conf. Only that it may contain 3 parameters. Can you provide any kind of guidance? It does sound like pam_mysql is the same thing as nss-mysql? I do have pam_mysql working where it uses the mysql db to authenticate with vsftpd virtual users.

      – Tom
      Mar 24 '13 at 17:58












    • PAM is not same as NSS. PAM is targeted towards authentication, whereas NSS' objective is to resolve names (hostnames, usernames, etc.). Most of the distros provide a package for nss_mysql, e.g. Debian and derivatives provide it as libnss-mysql. And, yes it's not updated for half-a-decade, but it works fine. Once you install the module, configure it, and add it to your nsswitch.conf(5), things will start working for you.

      – abbe
      Mar 24 '13 at 18:13











    • I added libnss-mysql from my distro. Tried out of the box and nothing is working. Any ideas on what I need to change in nsswitch.conf?

      – Tom
      Mar 24 '13 at 18:53













    0












    0








    0







    For user lookups by PAM module to succeed, you need to enable NSS module for MySQL in nsswitch.conf(5). nss_mysql is your friend.






    share|improve this answer













    For user lookups by PAM module to succeed, you need to enable NSS module for MySQL in nsswitch.conf(5). nss_mysql is your friend.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Mar 24 '13 at 12:31









    abbeabbe

    346111




    346111












    • Any references you can provide on this? I can't seem to find anything about needing nss-mysql in my context?

      – Tom
      Mar 24 '13 at 16:52











    • How is pam_mkhomedir going to figure out the path to the home directory of the user it's supposed to create ? How does it know which database to use for resolving the user ? NSS provides it with that information. In your case, you'll be needing nss_mysql, assuming your user database is stored in a MySQL database.

      – abbe
      Mar 24 '13 at 17:10











    • I'm just trying to find out anything about this library. The link you provided is a very old project with no documentation. If I do install this it gives no indication on what to put in your nssswitch.conf. Only that it may contain 3 parameters. Can you provide any kind of guidance? It does sound like pam_mysql is the same thing as nss-mysql? I do have pam_mysql working where it uses the mysql db to authenticate with vsftpd virtual users.

      – Tom
      Mar 24 '13 at 17:58












    • PAM is not same as NSS. PAM is targeted towards authentication, whereas NSS' objective is to resolve names (hostnames, usernames, etc.). Most of the distros provide a package for nss_mysql, e.g. Debian and derivatives provide it as libnss-mysql. And, yes it's not updated for half-a-decade, but it works fine. Once you install the module, configure it, and add it to your nsswitch.conf(5), things will start working for you.

      – abbe
      Mar 24 '13 at 18:13











    • I added libnss-mysql from my distro. Tried out of the box and nothing is working. Any ideas on what I need to change in nsswitch.conf?

      – Tom
      Mar 24 '13 at 18:53

















    • Any references you can provide on this? I can't seem to find anything about needing nss-mysql in my context?

      – Tom
      Mar 24 '13 at 16:52











    • How is pam_mkhomedir going to figure out the path to the home directory of the user it's supposed to create ? How does it know which database to use for resolving the user ? NSS provides it with that information. In your case, you'll be needing nss_mysql, assuming your user database is stored in a MySQL database.

      – abbe
      Mar 24 '13 at 17:10











    • I'm just trying to find out anything about this library. The link you provided is a very old project with no documentation. If I do install this it gives no indication on what to put in your nssswitch.conf. Only that it may contain 3 parameters. Can you provide any kind of guidance? It does sound like pam_mysql is the same thing as nss-mysql? I do have pam_mysql working where it uses the mysql db to authenticate with vsftpd virtual users.

      – Tom
      Mar 24 '13 at 17:58












    • PAM is not same as NSS. PAM is targeted towards authentication, whereas NSS' objective is to resolve names (hostnames, usernames, etc.). Most of the distros provide a package for nss_mysql, e.g. Debian and derivatives provide it as libnss-mysql. And, yes it's not updated for half-a-decade, but it works fine. Once you install the module, configure it, and add it to your nsswitch.conf(5), things will start working for you.

      – abbe
      Mar 24 '13 at 18:13











    • I added libnss-mysql from my distro. Tried out of the box and nothing is working. Any ideas on what I need to change in nsswitch.conf?

      – Tom
      Mar 24 '13 at 18:53
















    Any references you can provide on this? I can't seem to find anything about needing nss-mysql in my context?

    – Tom
    Mar 24 '13 at 16:52





    Any references you can provide on this? I can't seem to find anything about needing nss-mysql in my context?

    – Tom
    Mar 24 '13 at 16:52













    How is pam_mkhomedir going to figure out the path to the home directory of the user it's supposed to create ? How does it know which database to use for resolving the user ? NSS provides it with that information. In your case, you'll be needing nss_mysql, assuming your user database is stored in a MySQL database.

    – abbe
    Mar 24 '13 at 17:10





    How is pam_mkhomedir going to figure out the path to the home directory of the user it's supposed to create ? How does it know which database to use for resolving the user ? NSS provides it with that information. In your case, you'll be needing nss_mysql, assuming your user database is stored in a MySQL database.

    – abbe
    Mar 24 '13 at 17:10













    I'm just trying to find out anything about this library. The link you provided is a very old project with no documentation. If I do install this it gives no indication on what to put in your nssswitch.conf. Only that it may contain 3 parameters. Can you provide any kind of guidance? It does sound like pam_mysql is the same thing as nss-mysql? I do have pam_mysql working where it uses the mysql db to authenticate with vsftpd virtual users.

    – Tom
    Mar 24 '13 at 17:58






    I'm just trying to find out anything about this library. The link you provided is a very old project with no documentation. If I do install this it gives no indication on what to put in your nssswitch.conf. Only that it may contain 3 parameters. Can you provide any kind of guidance? It does sound like pam_mysql is the same thing as nss-mysql? I do have pam_mysql working where it uses the mysql db to authenticate with vsftpd virtual users.

    – Tom
    Mar 24 '13 at 17:58














    PAM is not same as NSS. PAM is targeted towards authentication, whereas NSS' objective is to resolve names (hostnames, usernames, etc.). Most of the distros provide a package for nss_mysql, e.g. Debian and derivatives provide it as libnss-mysql. And, yes it's not updated for half-a-decade, but it works fine. Once you install the module, configure it, and add it to your nsswitch.conf(5), things will start working for you.

    – abbe
    Mar 24 '13 at 18:13





    PAM is not same as NSS. PAM is targeted towards authentication, whereas NSS' objective is to resolve names (hostnames, usernames, etc.). Most of the distros provide a package for nss_mysql, e.g. Debian and derivatives provide it as libnss-mysql. And, yes it's not updated for half-a-decade, but it works fine. Once you install the module, configure it, and add it to your nsswitch.conf(5), things will start working for you.

    – abbe
    Mar 24 '13 at 18:13













    I added libnss-mysql from my distro. Tried out of the box and nothing is working. Any ideas on what I need to change in nsswitch.conf?

    – Tom
    Mar 24 '13 at 18:53





    I added libnss-mysql from my distro. Tried out of the box and nothing is working. Any ideas on what I need to change in nsswitch.conf?

    – Tom
    Mar 24 '13 at 18:53













    0














    You could try using pam_script - it's a pam module that allows executing arbitrary shell scripts after a user session is opened (among others).



    You can find pam_script here: https://github.com/jeroennijhof/pam_script. It should also be installable via package managers, at least I've been able to install it through apt-get.



    Be careful, as vsftpd seems to have some problems with pam_script at least when it denies authentication, see my unresolved question: vsftpd freezes after failed pam_script authentication. However in your case it should not be a problem.






    share|improve this answer





























      0














      You could try using pam_script - it's a pam module that allows executing arbitrary shell scripts after a user session is opened (among others).



      You can find pam_script here: https://github.com/jeroennijhof/pam_script. It should also be installable via package managers, at least I've been able to install it through apt-get.



      Be careful, as vsftpd seems to have some problems with pam_script at least when it denies authentication, see my unresolved question: vsftpd freezes after failed pam_script authentication. However in your case it should not be a problem.






      share|improve this answer



























        0












        0








        0







        You could try using pam_script - it's a pam module that allows executing arbitrary shell scripts after a user session is opened (among others).



        You can find pam_script here: https://github.com/jeroennijhof/pam_script. It should also be installable via package managers, at least I've been able to install it through apt-get.



        Be careful, as vsftpd seems to have some problems with pam_script at least when it denies authentication, see my unresolved question: vsftpd freezes after failed pam_script authentication. However in your case it should not be a problem.






        share|improve this answer















        You could try using pam_script - it's a pam module that allows executing arbitrary shell scripts after a user session is opened (among others).



        You can find pam_script here: https://github.com/jeroennijhof/pam_script. It should also be installable via package managers, at least I've been able to install it through apt-get.



        Be careful, as vsftpd seems to have some problems with pam_script at least when it denies authentication, see my unresolved question: vsftpd freezes after failed pam_script authentication. However in your case it should not be a problem.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Apr 13 '17 at 12:14









        Community

        1




        1










        answered Feb 21 '15 at 21:02









        edziubudzikedziubudzik

        112




        112



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Server Fault!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f490840%2fvsftpd-pam-mysql-and-pam-mkhomedir-to-create-directories%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

            Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

            Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020