%3CLINGO-SUB%20id%3D%22lingo-sub-1515804%22%20slang%3D%22en-US%22%3EHow%20to%20configure%20windows%20authentication%20for%20Microsoft%20JDBC%20in%20Linux%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1515804%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSTRONG%3EHow%20to%20configure%20windows%20authentication%20for%20Microsoft%20JDBC%20in%20Linux.%20(We%20use%20Squirrel%20to%20do%20this%20test)%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3E%3CSTRONG%3EInstall%20necessary%20packages%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3Esudo%20yum%20install%20realmd%20krb5-workstation%3C%2FP%3E%0A%3CP%3Esudo%20yum%20install%20sssd-tools%3C%2FP%3E%0A%3CP%3Esudo%20yum%20install%20samba-common-tools%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%222%22%3E%0A%3CLI%3E%3CSTRONG%3EEdit%20below%20network%20adapter%20file%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3Esudo%20vi%20%2Fetc%2Fsysconfig%2Fnetwork-scripts%2Fifcfg-ens33%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EAdd%20below%20information%20into%20this%20file%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EPEERDNS%3Dno%3C%2FP%3E%0A%3CP%3EDNS1%3D**%3CAD%20domain%3D%22%22%20controller%3D%22%22%20ip%3D%22%22%20address%3D%22%22%3E**%3C%2FAD%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%223%22%3E%0A%3CLI%3E%3CSTRONG%3ERestart%20Network%20Service%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3Esudo%20systemctl%20restart%20network%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%224%22%3E%0A%3CLI%3E%3CSTRONG%3EAdd%20below%20information%20into%20%26nbsp%3B%2Fetc%2Fresolv.conf%20%26nbsp%3Bfile%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3Esudo%20vi%20%2Fetc%2Fresolv.conf%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Esearch%20MYTEST.COM%3C%2FP%3E%0A%3CP%3Enameserver%20**%3CAD%20domain%3D%22%22%20controller%3D%22%22%20ip%3D%22%22%20address%3D%22%22%3E**%3C%2FAD%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%225%22%3E%0A%3CLI%3E%3CSTRONG%3EModify%20%2Fetc%2Fhosts%20%26nbsp%3Bfile%2C%20add%20domain%20controller%20records%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3Esudo%20vi%20%2Fetc%2Fhosts%3CBR%20%2F%3E%3CBR%20%2F%3E192.168.232.128%26nbsp%3B%20Win2012AD%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%226%22%3E%0A%3CLI%3E%3CSTRONG%3ESpecify%20hostname%20in%20case%20the%20server%20hasn%E2%80%99t%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3Esudo%20vi%20%2Fetc%2Fhostname%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%227%22%3E%0A%3CLI%3E%3CSTRONG%3EJoin%20Linux%20server%20into%20windows%20domain.%20Please%20replace%20yellow%20highlighted%20domain%20name%20and%20domain%20account.%20This%20account%20should%20have%20permission%20to%20add%20computer%20into%20domain%20and%20also%20have%20permission%20to%20login%20SQL%20SERVER.%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3Esudo%20realm%20join%20MYTEST.COM%20-U%20'bobcai%40MYTEST.COM'%20-v%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%228%22%3E%0A%3CLI%3E%3CSTRONG%3EWhen%20you%20have%20successfully%20joined%20windows%20domain%2C%20please%20modify%20%26nbsp%3B%2Fetc%2Fkrb5.conf%26nbsp%3B%20file%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3Esudo%20vi%20%2Fetc%2Fkrb5.conf%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%23FF0000%22%3E%3CSTRONG%3EThe%20following%20yellow%20highlight%20parts%20should%20be%20changed%20to%20your%20own%20domain%20name.%20Domain%20name%20should%20be%20%E2%80%9Cuppercase%E2%80%9D%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%23%20Configuration%20snippets%20may%20be%20placed%20in%20this%20directory%20as%20well%3C%2FP%3E%0A%3CP%3Eincludedir%20%2Fetc%2Fkrb5.conf.d%2F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%5Blogging%5D%3C%2FP%3E%0A%3CP%3Edefault%20%3D%20FILE%3A%2Fvar%2Flog%2Fkrb5libs.log%3C%2FP%3E%0A%3CP%3Ekdc%20%3D%20FILE%3A%2Fvar%2Flog%2Fkrb5kdc.log%3C%2FP%3E%0A%3CP%3Eadmin_server%20%3D%20FILE%3A%2Fvar%2Flog%2Fkadmind.log%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%5Blibdefaults%5D%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3E%3CFONT%20color%3D%22%230000FF%22%3Edefault_tkt_enctypes%20%3D%20aes256-cts%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%230000FF%22%3Edefault_tgs_enctypes%20%3D%20aes256-cts%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%230000FF%22%3Epermitted_enctypes%20%3D%20aes256-cts%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3Edns_lookup_realm%20%3D%20false%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%230000FF%22%3Edns_lookup_kdc%20%3D%20yes%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3Eticket_lifetime%20%3D%2024h%3C%2FP%3E%0A%3CP%3Erenew_lifetime%20%3D%207d%3C%2FP%3E%0A%3CP%3Eforwardable%20%3D%20true%3C%2FP%3E%0A%3CP%3Erdns%20%3D%20false%3C%2FP%3E%0A%3CP%3Epkinit_anchors%20%3D%20%2Fetc%2Fpki%2Ftls%2Fcerts%2Fca-bundle.crt%3C%2FP%3E%0A%3CP%3Edefault_realm%20%3D%20%3CFONT%20color%3D%22%230000FF%22%3EMYTEST.COM%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3Edefault_ccache_name%20%3D%20KEYRING%3Apersistent%3A%25%7Buid%7D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Edefault_realm%20%3D%20MYTEST.COM%3C%2FP%3E%0A%3CP%3E%5Brealms%5D%3C%2FP%3E%0A%3CP%3E%23%20EXAMPLE.COM%20%3D%20%7B%3C%2FP%3E%0A%3CP%3E%23%26nbsp%3B%20kdc%20%3D%20kerberos.example.com%3C%2FP%3E%0A%3CP%3E%23%26nbsp%3B%20admin_server%20%3D%20kerberos.example.com%3C%2FP%3E%0A%3CP%3E%23%20%7D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EMYTEST.COM%20%3D%20%7B%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%230000FF%22%3E%26nbsp%3B%26nbsp%3B%20kdc%20%3D%20Win2012AD.MYTEST.COM%3A88%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%230000FF%22%3E%26nbsp%3B%26nbsp%3B%20admin_server%20%3D%20Win2012AD.MYTEST.COM%3A749%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%230000FF%22%3E%26nbsp%3B%26nbsp%3B%20default_domain%20%3D%20MYTEST.COM%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%7D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%5Bdomain_realm%5D%3C%2FP%3E%0A%3CP%3E%23%20.example.com%20%3D%20EXAMPLE.COM%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%229%22%3E%0A%3CLI%3E%3CSTRONG%3EUse%20%26nbsp%3BKinit%20%26nbsp%3Bto%20get%20Kerberos%20TGT.%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CFONT%20color%3D%22%23000000%22%3E%3CSTRONG%3EI%20will%20use%20%E2%80%9Cbobcai%E2%80%9D%20ticket%20to%20login%20SQL%20Server.%20So%20we%20need%20to%20run%20%E2%80%9Ckinit%20bobcai%E2%80%9D%20to%20get%20bobcai%E2%80%99s%20TGT%20package.%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%5Bbobcai%40centos7%20Packages%5D%24%20kinit%20bobcai%3C%2FP%3E%0A%3CP%3EPassword%20for%20%3CA%20href%3D%22mailto%3Abobcai%40MYTEST.COM%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ebobcai%40MYTEST.COM%3C%2FA%3E%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%2210%22%3E%0A%3CLI%3E%3CSTRONG%3EUse%20%26nbsp%3BKlist%20%26nbsp%3Bto%20verify%20bobcai%E2%80%99s%20Kerberos%20ticket%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%5Bbobcai%40centos7%20Packages%5D%24%20klist%3C%2FP%3E%0A%3CP%3ETicket%20cache%3A%20KEYRING%3Apersistent%3A1000%3A1000%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EDefault%20principal%3A%20%3CA%20href%3D%22mailto%3Abobcai%40MYTEST.COM%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ebobcai%40MYTEST.COM%3C%2FA%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EValid%20starting%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Expires%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Service%20principal%3C%2FP%3E%0A%3CP%3E03%2F03%2F2019%2018%3A55%3A06%26nbsp%3B%2003%2F04%2F2019%2004%3A55%3A06%26nbsp%3B%20%3CA%20href%3D%22mailto%3Akrbtgt%2FMYTEST.COM%40MYTEST.COM%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ekrbtgt%2FMYTEST.COM%40MYTEST.COM%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20renew%20until%2003%2F10%2F2019%2018%3A55%3A01%3C%2FP%3E%0A%3CP%3E%5Bbobcai%40centos7%20Packages%5D%24%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%2211%22%3E%0A%3CLI%3E%3CSTRONG%3EInstall%20Java%20using%20below%20commands%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%5Bbobcai%40JDBCTEST%20~%5D%24%20sudo%20su%3C%2FP%3E%0A%3CP%3E%5Bsudo%5D%20password%20for%20bobcai%3A%3C%2FP%3E%0A%3CP%3E%5Broot%40JDBCTEST%20bobcai%5D%23%20yum%20install%20java%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%2212%22%3E%0A%3CLI%3E%3CSTRONG%3EDownload%20Squirrel%20SQL%20client.%20We%20use%20this%20tool%20to%20verify%20JDBC%20connectivity%2Fauthentication%20issue.%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22http%3A%2F%2Fwww.squirrelsql.org%2F%23installation%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fwww.squirrelsql.org%2F%23installation%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%2213%22%3E%0A%3CLI%3E%3CSTRONG%3EInstall%20Squirrel.%20Download%20squirrel-sql-3.9.1-standard.jar%20from%20above%20official%20web%20site.%20Install%20it%20using%20below%20command%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%5Bbobcai%40JDBCTEST%20~%5D%24%20java%20-jar%20squirrel-sql-3.9.1-standard.jar%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Bob_Cai_0-1594427454358.jpeg%22%20style%3D%22width%3A%20550px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F204733iE6191E916DA81719%2Fimage-dimensions%2F550x411%3Fv%3D1.0%22%20width%3D%22550%22%20height%3D%22411%22%20title%3D%22Bob_Cai_0-1594427454358.jpeg%22%20alt%3D%22Bob_Cai_0-1594427454358.jpeg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Bob_Cai_1-1594427454365.jpeg%22%20style%3D%22width%3A%20547px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F204732iB221E94B10FF405C%2Fimage-dimensions%2F547x354%3Fv%3D1.0%22%20width%3D%22547%22%20height%3D%22354%22%20title%3D%22Bob_Cai_1-1594427454365.jpeg%22%20alt%3D%22Bob_Cai_1-1594427454365.jpeg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%2214%22%3E%0A%3CLI%3E%3CSTRONG%3EWhen%20Squirrel%20is%20installed%2C%20Please%20download%20Microsoft%20JDBC.%20I%20am%20using%20Microsoft%20JDBC%206.0%20to%20do%20this%20test.%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fwww.microsoft.com%2Fen-sg%2Fdownload%2Fdetails.aspx%3Fid%3D11774%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.microsoft.com%2Fen-sg%2Fdownload%2Fdetails.aspx%3Fid%3D11774%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%2215%22%3E%0A%3CLI%3E%3CSTRONG%3EUnzip%26nbsp%3B%20sqljdbc_6.0.8112.200_enu.tar.gz%26nbsp%3B%26nbsp%3B%20which%20has%20been%20downloaded%20from%20above%20link.%20You%20will%20find%20%E2%80%98sqljdbc_6.0%E2%80%99%20folder%20was%20created%20under%20the%20same%20path.%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%5Bbobcai%40JDBCTEST%20~%5D%24%20tar%20-zxf%20sqljdbc_6.0.8112.200_enu.tar.gz%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%2216%22%3E%0A%3CLI%3E%3CSTRONG%3EDouble%20click%20Squirrel%20icon%20on%20Desktop%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Bob_Cai_2-1594427454369.jpeg%22%20style%3D%22width%3A%20376px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F204731i6047AE0D18914CFB%2Fimage-dimensions%2F376x383%3Fv%3D1.0%22%20width%3D%22376%22%20height%3D%22383%22%20title%3D%22Bob_Cai_2-1594427454369.jpeg%22%20alt%3D%22Bob_Cai_2-1594427454369.jpeg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%2217%22%3E%0A%3CLI%3E%3CSTRONG%3EAdd%20SQLJDBC%20driver%20into%20Squirrel%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Bob_Cai_3-1594427454383.jpeg%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F204735iF33870ACCEFB6B76%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22Bob_Cai_3-1594427454383.jpeg%22%20alt%3D%22Bob_Cai_3-1594427454383.jpeg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ELoad%20sqljdbc42.jar%20in%20jre8%20folder.%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Bob_Cai_4-1594427454386.jpeg%22%20style%3D%22width%3A%20500px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F204734iD1962C3192DEB1B9%2Fimage-dimensions%2F500x347%3Fv%3D1.0%22%20width%3D%22500%22%20height%3D%22347%22%20title%3D%22Bob_Cai_4-1594427454386.jpeg%22%20alt%3D%22Bob_Cai_4-1594427454386.jpeg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Bob_Cai_5-1594427454395.jpeg%22%20style%3D%22width%3A%20789px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F204736iCBACC797147C3FFA%2Fimage-dimensions%2F789x436%3Fv%3D1.0%22%20width%3D%22789%22%20height%3D%22436%22%20title%3D%22Bob_Cai_5-1594427454395.jpeg%22%20alt%3D%22Bob_Cai_5-1594427454395.jpeg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%2218%22%3E%0A%3CLI%3E%3CSTRONG%3EAdd%20environment%20variable.%20%E2%80%98krb5cc_bobcai%E2%80%99%20is%20Kerberos%20ticket%20cache%20file.%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%5Bbobcai%40JDBCTEST%20~%5D%24%20sudo%20vi%20%2Fetc%2Fprofile%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3Eexport%20KRB5CCNAME%3D%2Fhome%2Fbobcai%2Fkrb5cc_bobcai%3C%2FP%3E%0A%3CP%3Eexport%20JAVA_HOME%3D%2Fusr%2Flib%2Fjvm%2Fjre-1.8.0%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3E19.%20Create%20SQLJDBCDriver.conf%20file%20inside%20squirrel-sql-3.9.1%20folder.%20Put%20below%20information%20into%20SQLJDBCDriver.conf%20file%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESQLJDBCDriver%20%7B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%20com.sun.security.auth.module.Krb5LoginModule%20required%20useTicketCache%3Dtrue%3B%3C%2FP%3E%0A%3CP%3E%7D%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%2220%22%3E%0A%3CLI%3E%3CSTRONG%3EGo%20into%20squirrel-sql-3.9.1%20folder%2C%20modify%20squirrel-sql.bat%20file.%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CBR%20%2F%3E%5Bbobcai%40JDBCTEST%20squirrel-sql-3.9.1%5D%24%20vi%20squirrel-sql.bat%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3EAdd%20below%20parameters%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CBR%20%2F%3E-Djava.security.auth.login.config%3DSQLJDBCDriver.conf%20-Djava.security.krb5.conf%3D%2Fetc%2Fkrb5.conf%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Bob_Cai_6-1594427454403.jpeg%22%20style%3D%22width%3A%20689px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F204737i95DFBAE04A061858%2Fimage-dimensions%2F689x355%3Fv%3D1.0%22%20width%3D%22689%22%20height%3D%22355%22%20title%3D%22Bob_Cai_6-1594427454403.jpeg%22%20alt%3D%22Bob_Cai_6-1594427454403.jpeg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%2221%22%3E%0A%3CLI%3E%3CSTRONG%3EThen%20test%20windows%20authentication%20in%20Squirrel%20in%20Linux.%20Connection%20successful%20!%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Bob_Cai_7-1594427454435.png%22%20style%3D%22width%3A%201149px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F204738i05B0F6485DE7AD54%2Fimage-dimensions%2F1149x371%3Fv%3D1.0%22%20width%3D%221149%22%20height%3D%22371%22%20title%3D%22Bob_Cai_7-1594427454435.png%22%20alt%3D%22Bob_Cai_7-1594427454435.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1515804%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22blog0002.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F204730iC36FBC92201946A5%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22blog0002.jpg%22%20alt%3D%22blog0002.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E
Microsoft

How to configure windows authentication for Microsoft JDBC in Linux. (We use Squirrel to do this test)

 

  1. Install necessary packages

sudo yum install realmd krb5-workstation

sudo yum install sssd-tools

sudo yum install samba-common-tools

 

  1. Edit below network adapter file

sudo vi /etc/sysconfig/network-scripts/ifcfg-ens33

 

Add below information into this file

PEERDNS=no

DNS1=**<AD domain controller IP address>**

 

  1. Restart Network Service

sudo systemctl restart network

 

  1. Add below information into  /etc/resolv.conf  file

sudo vi /etc/resolv.conf

 

search MYTEST.COM

nameserver **<AD domain controller IP address>**

 

  1. Modify /etc/hosts  file, add domain controller records

sudo vi /etc/hosts

192.168.232.128  Win2012AD

 

  1. Specify hostname in case the server hasn’t

sudo vi /etc/hostname

 

  1. Join Linux server into windows domain. Please replace yellow highlighted domain name and domain account. This account should have permission to add computer into domain and also have permission to login SQL SERVER.

sudo realm join MYTEST.COM -U 'bobcai@MYTEST.COM' -v

 

  1. When you have successfully joined windows domain, please modify  /etc/krb5.conf  file

sudo vi /etc/krb5.conf

 

The following yellow highlight parts should be changed to your own domain name. Domain name should be “uppercase”

 

# Configuration snippets may be placed in this directory as well

includedir /etc/krb5.conf.d/

 

[logging]

default = FILE:/var/log/krb5libs.log

kdc = FILE:/var/log/krb5kdc.log

admin_server = FILE:/var/log/kadmind.log

 

[libdefaults]


default_tkt_enctypes = aes256-cts

default_tgs_enctypes = aes256-cts

permitted_enctypes = aes256-cts

dns_lookup_realm = false

dns_lookup_kdc = yes

ticket_lifetime = 24h

renew_lifetime = 7d

forwardable = true

rdns = false

pkinit_anchors = /etc/pki/tls/certs/ca-bundle.crt

default_realm = MYTEST.COM

default_ccache_name = KEYRING:persistent:%{uid}

 

default_realm = MYTEST.COM

[realms]

# EXAMPLE.COM = {

#  kdc = kerberos.example.com

#  admin_server = kerberos.example.com

# }

 

MYTEST.COM = {

   kdc = Win2012AD.MYTEST.COM:88

   admin_server = Win2012AD.MYTEST.COM:749

   default_domain = MYTEST.COM

}

 

[domain_realm]

# .example.com = EXAMPLE.COM

 

  1. Use  Kinit  to get Kerberos TGT.

I will use “bobcai” ticket to login SQL Server. So we need to run “kinit bobcai” to get bobcai’s TGT package.

 

[bobcai@centos7 Packages]$ kinit bobcai

Password for bobcai@MYTEST.COM:

 

  1. Use  Klist  to verify bobcai’s Kerberos ticket

 

[bobcai@centos7 Packages]$ klist

Ticket cache: KEYRING:persistent:1000:1000

Default principal: bobcai@MYTEST.COM

 

Valid starting       Expires              Service principal

03/03/2019 18:55:06  03/04/2019 04:55:06  krbtgt/MYTEST.COM@MYTEST.COM

      renew until 03/10/2019 18:55:01

[bobcai@centos7 Packages]$

 

 

  1. Install Java using below commands

 

[bobcai@JDBCTEST ~]$ sudo su

[sudo] password for bobcai:

[root@JDBCTEST bobcai]# yum install java

 

 

  1. Download Squirrel SQL client. We use this tool to verify JDBC connectivity/authentication issue.

 

http://www.squirrelsql.org/#installation

 

  1. Install Squirrel. Download squirrel-sql-3.9.1-standard.jar from above official web site. Install it using below command

 

[bobcai@JDBCTEST ~]$ java -jar squirrel-sql-3.9.1-standard.jar

Bob_Cai_0-1594427454358.jpeg

 

 

Bob_Cai_1-1594427454365.jpeg

 

 

  1. When Squirrel is installed, Please download Microsoft JDBC. I am using Microsoft JDBC 6.0 to do this test.

    https://www.microsoft.com/en-sg/download/details.aspx?id=11774

 

  1. Unzip  sqljdbc_6.0.8112.200_enu.tar.gz   which has been downloaded from above link. You will find ‘sqljdbc_6.0’ folder was created under the same path.

 

[bobcai@JDBCTEST ~]$ tar -zxf sqljdbc_6.0.8112.200_enu.tar.gz

 

  1. Double click Squirrel icon on Desktop

Bob_Cai_2-1594427454369.jpeg

 

 

  1. Add SQLJDBC driver into Squirrel

 

Bob_Cai_3-1594427454383.jpeg

 

 

Load sqljdbc42.jar in jre8 folder.

 

Bob_Cai_4-1594427454386.jpeg

 

 

Bob_Cai_5-1594427454395.jpeg

 

 

  1. Add environment variable. ‘krb5cc_bobcai’ is Kerberos ticket cache file.

 

[bobcai@JDBCTEST ~]$ sudo vi /etc/profile


export KRB5CCNAME=/home/bobcai/krb5cc_bobcai

export JAVA_HOME=/usr/lib/jvm/jre-1.8.0

19. Create SQLJDBCDriver.conf file inside squirrel-sql-3.9.1 folder. Put below information into SQLJDBCDriver.conf file

 

SQLJDBCDriver {

   com.sun.security.auth.module.Krb5LoginModule required useTicketCache=true;

};

 

 

  1. Go into squirrel-sql-3.9.1 folder, modify squirrel-sql.bat file.


[bobcai@JDBCTEST squirrel-sql-3.9.1]$ vi squirrel-sql.bat

Add below parameters

-Djava.security.auth.login.config=SQLJDBCDriver.conf -Djava.security.krb5.conf=/etc/krb5.conf

 

Bob_Cai_6-1594427454403.jpeg

 

 

  1. Then test windows authentication in Squirrel in Linux. Connection successful !

Bob_Cai_7-1594427454435.png