Thread View: csu.unix.linux
4 messages
4 total messages
Started by Adam Carheden
Tue, 08 Feb 2000 00:00
UNIX auth via an NT domain
Author: Adam Carheden
Date: Tue, 08 Feb 2000 00:00
Date: Tue, 08 Feb 2000 00:00
55 lines
2633 bytes
2633 bytes
I have a Linux box running an ftp server, and I need to give the users
of my NT domain access. The samba server does a great job of
authenticating them this way, and I've set up a script to add a record
to my unix password db if that user can be authenticated via my NT
server. This it creates an entry with ! as the password, so these users
can't login to my unix box via telnet or ftp though. I have two
solutions, neither of which seem to work:
1) Have the scrip assign them their NT password when a new user is
created. I don't think passwords can be assigned with the useradd
command, which is what the script uses though. Plus, I don't know how
to get at the password from samba to pass it to the scrip in the first
place.
2) Use a PAM module. I've have pam_smb_auth, but it simply doesn't work
(yes, I have a pam_smb.conf file). Just for kicks, I used the following
line in pam.d/ftp
auth required /lib/security/pam_smb_auth.so debug
Loggin on as an NT user failed and produced the following in
/var/log/secure
Feb 8 18:09:08 ftp in.ftpd[11797]: connect from 129.82.197.251
Feb 8 18:09:11 ftp ftpd[11797]: pam_smb: Local UNIX username/password
check inc
orrect.
Feb 8 18:09:11 ftp ftpd[11797]: pam_smb: Configuration Data, Primary
OTTER, Bac
kup , Domain CNHP.
I downloaded pam_ntdom. 0.24, the latest, doesn't compile. I get
rpc_validate.c:62: parse error before `('
every time DEBUG() is called. I've traced this to the following lines
in smb.h:
#define DEBUG_BODY( level, body ) \
( (DEBUGLEVEL >= (level)) && ((debuglog body) == 0) )
#define DEBUG_HDR(level)
#define DEBUG( level, body ) (void)(DEBUG_HDR(level) &&
DEBUG_BODY(level, body))
#define DEBUGADD( level, body ) (void)(DEBUG_BODY(level, body))
It looks okay to me. Does anyone who understands #define derectives
better see any errors?
Verison 0.23 compiles okay, but produces pam_smb_auth.so, not
pam_ntdom.so as the docs say. This fails the same way as the original
pam_smb_auth.so module (which came from who knows where), except it
denys quicker.
--
Adam
Re: UNIX auth via an NT domain
Author: Michael Dwyer
Date: Tue, 08 Feb 2000 00:00
Date: Tue, 08 Feb 2000 00:00
67 lines
3331 bytes
3331 bytes
Adam Carheden <carheden@holly.colostate.edu> wrote:
: I have a Linux box running an ftp server, and I need to give the users
: of my NT domain access. The samba server does a great job of
: authenticating them this way, and I've set up a script to add a record
: to my unix password db if that user can be authenticated via my NT
: server. This it creates an entry with ! as the password, so these users
: can't login to my unix box via telnet or ftp though. I have two
: solutions, neither of which seem to work:
Uhhh... how are you doing this? Are you just sharing the FTP directory
with Samba, and telling samba to use your NT domain controller as a
password server? This would allow them access without FTP and telnet --
indeed, they wouldn't even need an entry in the passwd list, if I read
this all correctly. But anyway... We do something like this at work.
: 1) Have the scrip assign them their NT password when a new user is
: created. I don't think passwords can be assigned with the useradd
: command, which is what the script uses though. Plus, I don't know how
: to get at the password from samba to pass it to the scrip in the first
: place.
I think password /can/ be defined with useradd, but you don't give it the
password -- you give it the pre-crypted password string. This is, obviously,
kind of a pain, since I don't think crypt hangs out in the open. Here's
the C-code I use -- modify as needed - its pretty ugly.
*
* Encrypt - Run a password through the UNIX Crypt system
* and see what comes out. Useful for filling out InterNIC
* forms. :)
*
* Compile like this:
* gcc -c encrypt.c
* gcc -o encrypt encrypt.o -lcrypt
*/
#define _XOPEN_SOURCE
#include <unistd.h>
int main()
{
char passwd[256];
char salt[3];
printf ("NOTE: I'm not gonna hide your password, so it\n");
printf ("is going to appear on the screen. Suck it up.\n");
printf ("Enter Your Password:");
scanf ("%s", passwd);
printf ("\nSalt is the name for the two characters used to\n");
printf ("perturb the encoder. Its sometimes the first two\n");
printf ("chars of a passwd string.\n");
printf ("Enter Your Salt:");
scanf ("%s", salt);
printf ("\nCrypted String is: %s\n", crypt(passwd, salt));
}
: 2) Use a PAM module. I've have pam_smb_auth, but it simply doesn't work
: (yes, I have a pam_smb.conf file). Just for kicks, I used the following
: line in pam.d/ftp
Uhhh... I dunno how to use PAM... Sorry.
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Michael J. Dwyer I doubt, therefore I might be.
mdwyer@holly.ColoState.edu http://WWW.CS.ColoState.EDU/~dwyer/
Computer Science Major Amateur Radio Tech N0ZAP
Re: UNIX auth via an NT domain
Author: Adam Carheden
Date: Wed, 09 Feb 2000 00:00
Date: Wed, 09 Feb 2000 00:00
22 lines
1652 bytes
1652 bytes
Michael Dwyer wrote: > Uhhh... how are you doing this? Are you just sharing the FTP directory > with Samba, and telling samba to use your NT domain controller as a > password server? This would allow them access without FTP and telnet -- > indeed, they wouldn't even need an entry in the passwd list, if I read > this all correctly. But anyway... We do something like this at work. Yes, and that does work, but some people want UNIX logins too. Can you blame them? > I think password /can/ be defined with useradd, but you don't give it the What version of useradd do you have? I've read the man page backwards and forwards, but no mention of setting a password. passwd also seems to be interactive only. How non-unix. And of course even if I do solve this problem, how do I get samba to report the password? I can use %u to pass the username to my addsmbuser script, but I can't find any documentation for the password. I guess %p is a good guess, but... -- Adam Carheden carheden@holly.ColoState.EDU
Re: UNIX auth via an NT domain
Author: Michael Dwyer
Date: Thu, 10 Feb 2000 00:00
Date: Thu, 10 Feb 2000 00:00
21 lines
1648 bytes
1648 bytes
Adam Carheden <carheden@holly.colostate.edu> wrote: :> I think password /can/ be defined with useradd, but you don't give it the : What version of useradd do you have? I've read the man page backwards : and forwards, but no mention of setting a password. passwd also seems : to be interactive only. How non-unix. And of course even if I do solve Make sure you try both USERADD and ADDUSER. They appear to be different. This is on Slackware, by the way. I'll take another look at it and see what I find. I may be horribly mistaken, and may have dreamed the whole thing... I found out the interactive-only passwd, too. What a pain. Since I didn't want to encode them all (I hadne't written that code yet), I just started typing them all in by hand. Wheee! -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Michael J. Dwyer I doubt, therefore I might be. mdwyer@holly.ColoState.edu http://WWW.CS.ColoState.EDU/~dwyer/ Computer Science Major Amateur Radio Tech N0ZAP
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads