solaris md5 password authentication

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



this is my first post to this list, I'll start off by saying I'm glad to
have found it, being that it looks more active than some other resources I
have found.

here's what I'm trying to do, I'm not sure if it will work the way that I
might want but here goes : I need to migrate users account from a redhat box
to a Solaris box ( I realize this should be the other way around...), but I
would like for them to be able to keep their passwords intact since I have
to migrate *alot* of users. Sooo, I'm hoping that I can copy the passwords
from the redhat box (MD5 encrypted I believe) to the Solaris box (which uses
DES I believe, I'm not too familiar with Solaris) and have the Solaris
machine be able to understand the md5 passwords as well as native solaris
ones.

>From what I've gathered I need to compile a pam module and insert into the
pam.conf authentication stack. I took a guess and tried to compile just the
pam_unix module, I had some trouble doing this :

# uname -a
SunOS 5.9 Generic sun4u sparc SUNW,Ultra-5_10
# cd Linux-PAM-0.77
# ./configure

... [ autoconf out ]

# mkdir security
# cp _pam_aconf.h ./security/    [ make it so we can find _pam_aconf.h, code
includes <security/_pam_aconf.h> ]
# cd ./modules/pam_unix/
# make
mkdir -p ./dynamic

*** Building pam-unix module of the framework...

gcc -Wall -Wwrite-strings       -Wpointer-arith -Wcast-qual -Wcast-align
-Wstrict-prototypes -Wmissing-prototypes        -Wnested-externs -Winline
-Wshadow -Dsunos -ansi -pedantic -I./include
-I/export/install/Linux-PAM-0.77/libpam/include
-I/export/install/Linux-PAM-0.77
-I/export/install/Linux-PAM-0.77/libpamc/include   -D"USE_LCKPWDF"
-DCHKPWD_HELPER=\"/sbin/unix_chkpwd\"  -DHIGHFIRST -D'MD5Name(x)=Good##x' \
         -c md5.c -o md5_good.o
md5.c: In function `byteReverse':
md5.c:39: warning: cast increases required alignment of target type
md5.c: In function `GoodMD5Update':
md5.c:90: warning: cast increases required alignment of target type
md5.c:99: warning: cast increases required alignment of target type
md5.c: In function `GoodMD5Final':
md5.c:134: warning: cast increases required alignment of target type
md5.c:145: warning: cast increases required alignment of target type
md5.c:146: warning: cast increases required alignment of target type
md5.c:148: warning: cast increases required alignment of target type
gcc -Wall -Wwrite-strings       -Wpointer-arith -Wcast-qual -Wcast-align
-Wstrict-prototypes -Wmissing-prototypes        -Wnested-externs -Winline
-Wshadow -Dsunos -ansi -pedantic -I./include
-I/export/install/Linux-PAM-0.77/libpam/include
-I/export/install/Linux-PAM-0.77
-I/export/install/Linux-PAM-0.77/libpamc/include   -D"USE_LCKPWDF"
-DCHKPWD_HELPER=\"/sbin/unix_chkpwd\"  -D'MD5Name(x)=Broken##x' \
         -c md5.c -o md5_broken.o
md5.c: In function `BrokenMD5Update':
md5.c:90: warning: cast increases required alignment of target type
md5.c:99: warning: cast increases required alignment of target type
md5.c: In function `BrokenMD5Final':
md5.c:134: warning: cast increases required alignment of target type
md5.c:145: warning: cast increases required alignment of target type
md5.c:146: warning: cast increases required alignment of target type
md5.c:148: warning: cast increases required alignment of target type
gcc -Wall -Wwrite-strings       -Wpointer-arith -Wcast-qual -Wcast-align
-Wstrict-prototypes -Wmissing-prototypes        -Wnested-externs -Winline
-Wshadow -Dsunos -ansi -pedantic -I./include
-I/export/install/Linux-PAM-0.77/libpam/include
-I/export/install/Linux-PAM-0.77
-I/export/install/Linux-PAM-0.77/libpamc/include   -D"USE_LCKPWDF"
-DCHKPWD_HELPER=\"/sbin/unix_chkpwd\"  -D'MD5Name(x)=Good##x' \
         -c md5_crypt.c -o md5_crypt_good.o
gcc -Wall -Wwrite-strings       -Wpointer-arith -Wcast-qual -Wcast-align
-Wstrict-prototypes -Wmissing-prototypes        -Wnested-externs -Winline
-Wshadow -Dsunos -ansi -pedantic -I./include
-I/export/install/Linux-PAM-0.77/libpam/include
-I/export/install/Linux-PAM-0.77
-I/export/install/Linux-PAM-0.77/libpamc/include   -D"USE_LCKPWDF"
-DCHKPWD_HELPER=\"/sbin/unix_chkpwd\"  -D'MD5Name(x)=Broken##x' \
         -c md5_crypt.c -o md5_crypt_broken.o
gcc -c -Wall -Wwrite-strings    -Wpointer-arith -Wcast-qual -Wcast-align
-Wstrict-prototypes -Wmissing-prototypes        -Wnested-externs -Winline
-Wshadow -Dsunos -ansi -pedantic -I./include
-I/export/install/Linux-PAM-0.77/libpam/include
-I/export/install/Linux-PAM-0.77
-I/export/install/Linux-PAM-0.77/libpamc/include   -D"USE_LCKPWDF"
-DCHKPWD_HELPER=\"/sbin/unix_chkpwd\" yppasswd_xdr.c
gcc -c -Wall -Wwrite-strings    -Wpointer-arith -Wcast-qual -Wcast-align
-Wstrict-prototypes -Wmissing-prototypes        -Wnested-externs -Winline
-Wshadow -Dsunos -ansi -pedantic -I./include
-I/export/install/Linux-PAM-0.77/libpam/include
-I/export/install/Linux-PAM-0.77
-I/export/install/Linux-PAM-0.77/libpamc/include   -D"USE_LCKPWDF"
-DCHKPWD_HELPER=\"/sbin/unix_chkpwd\" bigcrypt.c
gcc -Wall -Wwrite-strings       -Wpointer-arith -Wcast-qual -Wcast-align
-Wstrict-prototypes -Wmissing-prototypes        -Wnested-externs -Winline
-Wshadow -Dsunos -ansi -pedantic -I./include
-I/export/install/Linux-PAM-0.77/libpam/include
-I/export/install/Linux-PAM-0.77
-I/export/install/Linux-PAM-0.77/libpamc/include   -D"USE_LCKPWDF"
-DCHKPWD_HELPER=\"/sbin/unix_chkpwd\" -DPAM_DYNAMIC   -c pam_unix_auth.c -o
dynamic/pam_unix_auth.o
pam_unix_auth.c: In function `pam_sm_authenticate':
pam_unix_auth.c:130: warning: subscript has type `char'
gcc -Wall -Wwrite-strings       -Wpointer-arith -Wcast-qual -Wcast-align
-Wstrict-prototypes -Wmissing-prototypes        -Wnested-externs -Winline
-Wshadow -Dsunos -ansi -pedantic -I./include
-I/export/install/Linux-PAM-0.77/libpam/include
-I/export/install/Linux-PAM-0.77
-I/export/install/Linux-PAM-0.77/libpamc/include   -D"USE_LCKPWDF"
-DCHKPWD_HELPER=\"/sbin/unix_chkpwd\" -DPAM_DYNAMIC   -c pam_unix_acct.c -o
dynamic/pam_unix_acct.o
pam_unix_acct.c: In function `pam_sm_acct_mgmt':
pam_unix_acct.c:182: warning: implicit declaration of function `snprintf'
gcc -Wall -Wwrite-strings       -Wpointer-arith -Wcast-qual -Wcast-align
-Wstrict-prototypes -Wmissing-prototypes        -Wnested-externs -Winline
-Wshadow -Dsunos -ansi -pedantic -I./include
-I/export/install/Linux-PAM-0.77/libpam/include
-I/export/install/Linux-PAM-0.77
-I/export/install/Linux-PAM-0.77/libpamc/include   -D"USE_LCKPWDF"
-DCHKPWD_HELPER=\"/sbin/unix_chkpwd\" -DPAM_DYNAMIC   -c pam_unix_sess.c -o
dynamic/pam_unix_sess.o
gcc -Wall -Wwrite-strings       -Wpointer-arith -Wcast-qual -Wcast-align
-Wstrict-prototypes -Wmissing-prototypes        -Wnested-externs -Winline
-Wshadow -Dsunos -ansi -pedantic -I./include
-I/export/install/Linux-PAM-0.77/libpam/include
-I/export/install/Linux-PAM-0.77
-I/export/install/Linux-PAM-0.77/libpamc/include   -D"USE_LCKPWDF"
-DCHKPWD_HELPER=\"/sbin/unix_chkpwd\" -DPAM_DYNAMIC   -c pam_unix_passwd.c
-o dynamic/pam_unix_passwd.o
pam_unix_passwd.c: In function `getNISserver':
pam_unix_passwd.c:190: warning: passing arg 2 of `yp_master' discards
qualifiers from pointer target type
pam_unix_passwd.c: In function `save_old_password':
pam_unix_passwd.c:298: warning: implicit declaration of function `snprintf'
pam_unix_passwd.c: In function `pam_sm_chauthtok':
pam_unix_passwd.c:726: warning: subscript has type `char'
gcc -Wall -Wwrite-strings       -Wpointer-arith -Wcast-qual -Wcast-align
-Wstrict-prototypes -Wmissing-prototypes        -Wnested-externs -Winline
-Wshadow -Dsunos -ansi -pedantic -I./include
-I/export/install/Linux-PAM-0.77/libpam/include
-I/export/install/Linux-PAM-0.77
-I/export/install/Linux-PAM-0.77/libpamc/include   -D"USE_LCKPWDF"
-DCHKPWD_HELPER=\"/sbin/unix_chkpwd\" -DPAM_DYNAMIC   -c support.c -o
dynamic/support.o
support.c: In function `_unix_blankpasswd':
support.c:400: warning: implicit declaration of function `strdup'
support.c:400: warning: assignment makes pointer from integer without a cast
support.c:402: warning: assignment makes pointer from integer without a cast
support.c: In function `_unix_run_helper_binary':
support.c:456: warning: function declaration isn't a prototype
support.c:472: warning: assignment makes pointer from integer without a cast
support.c:473: warning: assignment makes pointer from integer without a cast
support.c: In function `_unix_verify_password':
support.c:572: warning: assignment makes pointer from integer without a cast
support.c:574: warning: assignment makes pointer from integer without a cast
support.c:671: warning: assignment makes pointer from integer without a cast
support.c:674: warning: assignment makes pointer from integer without a cast
support.c: In function `_unix_read_password':
support.c:829: warning: assignment makes pointer from integer without a cast
gcc -shared -Xlinker -x -o pam_unix.so dynamic/pam_unix_auth.o
dynamic/pam_unix_acct.o dynamic/pam_unix_sess.o dynamic/pam_unix_passwd.o
dynamic/support.o md5_good.o md5_broken.o md5_crypt_good.o
md5_crypt_broken.o yppasswd_xdr.o bigcrypt.o    
/usr/ccs/bin/ld: illegal option -- x

...[ ld help options ] 

collect2: ld returned 1 exit status
make: *** [pam_unix.so] Error 1 

...[ linking fails, lets try it manually with -G an -z redlocsym since gcc
-shared is wily on solaris when linking against static or when not -fpic in
this case....i think, i don't know ]
# gcc -G -Xlinker -z -Xlinker redlocsym -o pam_unix.so
dynamic/pam_unix_auth.o dynamic/pam_unix_acct.o dynamic/pam_unix_sess.o
dynamic/pam_unix_passwd.o dynamic/support.o md5_good.o md5_broken.o
md5_crypt_good.o md5_crypt_broken.o yppasswd_xdr.o bigcrypt.o   

# ls
CHANGELOG           bigcrypt.o          md5.h               md5_crypt_good.o
pam_unix_auth.c     support.h           yppasswd_xdr.o
Makefile            dynamic             md5_broken.o        md5_good.o
pam_unix_passwd.c   unix_chkpwd.c
README              lckpwdf.-c          md5_crypt.c         pam_unix.so
pam_unix_sess.c     yppasswd.h
bigcrypt.c          md5.c               md5_crypt_broken.o  pam_unix_acct.c
support.c           yppasswd_xdr.c

i think it works, I have a pam_unix.so.....

I hope some of the above helps someone, but also would like to know if I'm
going about this the right way, any comments of suggestions would be
****greatly appreciated****.

Jerry Bonner
----------------------------------
jerry.bonner@cpinternet.com







_______________________________________________

Pam-list@redhat.com
https://listman.redhat.com/mailman/listinfo/pam-list

[Index of Archives]     [Fedora Users]     [Kernel]     [Red Hat Install]     [Linux for the blind]     [Gimp]

  Powered by Linux