ivaneeo's blog

          自由的力量,自由的生活。

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            669 Posts :: 0 Stories :: 64 Comments :: 0 Trackbacks

          From a convenience perspective, I want to authenticate as infrequently as possible. However, security requirements suggest that I should be authenticated for all sorts of services. This means that Single Sign On and forwardable authentication credentials would be useful.

          Within an individual organisation at least, it is useful and fairly straightforward to have centralised control for authentication services. More and more authorisation and applications services are able to use centralised authentication services such as Kerberos.

          This document will demonstrate how to configure a machine running OpenSSH server to use GSSAPI so that users can log in if they have authorised kerberos tickets. This is not the place for extensive explanations about tickets or how to set up the Key Distribution Center(KDC) in the first place or how to build or install the necessary software on various different unixlike systems. Likely, your distribution's package management system can provide you with what you need.

          Kerberos

          All destination machines should have /etc/krb5.conf modified to allow forwardable tickets:

          [libdefaults]     default_realm = ALLGOODBITS.ORG     forwardable = TRUE [realms]     ALLGOODBITS.ORG = {                     kdc = kerberos.allgoodbits.org                     } 

          Using kadmin, create a principal for a user:

          kadmin> ank <username>@<REALM> 

          Here the process differs depending upon whether you're using MIT Kerberos (probably) or Heimdal.

          MIT

          Create a principal for the host:

          kadmin> ank -randkey host/<FQDN>@<REALM> 

          Extract the key for the host principal to a keytab file and locate it correctly on the ssh server:

          kadmin> ktadd -k /tmp/<FQDN>.keytab host/<FQDN> 

          Heimdal

          Create a principal for the host:

          kadmin> ank -r host/<FQDN>@<REALM> 

          Extract the key for the host principal to a keytab file and locate it correctly on the ssh server:

          kadmin> ext -k /tmp/<FQDN>.keytab host/<FQDN>@<REALM> 

          SSH

          Then we need to take the keytab file into which you extracted the key for the host principal and copy it to the location on the ssh server where sshd will look for it, probably /etc/krb5.keytab.

          We need to configure sshd_config(5). The important options start with GSSAPI, not to be confused with the Kerberos options which are merely for KDC-validated password authentication; the GSSAPI method allows authentication and login based upon existing tickets. In other words, the "Kerberos" method requires you to enter your password (again), GSSAPI will allow login based on upon the tickets you already have.

          sshd_config:

          GSSAPIAuthentication yes GSSAPICleanupCredentials yes PermitRootLogin without-password 

          ssh_config:

          GSSAPIAuthentication yes GSSAPIDelegateCredentials yes 

          PAM

          Linux Pluggable Authentication Modules(PAM) provide a common framework for authentication/authorisation for applications.

          /etc/pam.d/common-account:

          account sufficient      pam_krb5.so     use_first_pass 

          /etc/pam.d/common-auth:

          auth    sufficient      pam_krb5.so     use_first_pass 

          /etc/pam.d/common-password:

          password        sufficient      pam_krb5.so 

          /etc/pam.d/common-session:

          session optional      pam_krb5.so 

          This is sufficient to allow OpenAFS based home directories because although AFS uses Kerberosv4, MIT Kerberos does 5 to 4 ticket conversion on the fly.

          Troubleshooting

          • As with anything concerned with kerberos, make sure you have NTP and DNS working properly before you even start.
          • ssh -v can give you a lot of valuable information.
          • read your logs.
          posted on 2013-10-12 18:12 ivaneeo 閱讀(318) 評論(0)  編輯  收藏 所屬分類: GNU牛力
          主站蜘蛛池模板: 德庆县| 濮阳县| 祁阳县| 霞浦县| 雷波县| 绥芬河市| 白玉县| 张家港市| 迁安市| 紫阳县| 卢氏县| 凤冈县| 甘谷县| 正定县| 噶尔县| 峨眉山市| 岑溪市| 县级市| 北宁市| 曲周县| 繁峙县| 英超| 华池县| 瑞昌市| 巴林左旗| 中方县| 鄂伦春自治旗| 滨州市| 南京市| 双峰县| 定州市| 贵州省| 绥化市| 绥江县| 陈巴尔虎旗| 华亭县| 门源| 成安县| 襄垣县| 白山市| 克什克腾旗|