简体   繁体   中英

Spring security authenticate against local linux account

I would like to use the existing user accounts on my redhat server for users to login with. The redhat server uses active directory to authenticate with, but I cannot get access to authenticate with AD directly.

My web app will be using spring security.

Is it possible to use the redhat server's user accounts to authenticate against with spring security? (note: su does not support passwords given on the command line with my server ("-S")).

I was digging around but could not find a sample code, but you could use PAM.

I found this project in GitHub https://github.com/kohsuke/libpam4j , which is a Java implementation of PAM (I don't know if it is active or if it will provide what you need).

Also, if sudo doesn't support passwords, you could try with expect

spawn "/bin/su" "bob"
expect "Password:"
send "userspassword\r"
expect "^\\$"
send "ls"
expect -re "^\\$"
send "exit\r"
expect eof

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM