所以我必须在本地使用kinit键签作为特定的主体。
由于远程服务器上的Kerberose kdc是我在vpn上访问的,所以我需要使用ssh来访问服务器,从而对服务进行隧道操作。
为此,我做了以下工作:
但当我试着动动
KRB5_TRACE=/dev/stdout kinit -kt ${PRINCIPAL_KEYTAB}.keytab ${PRINCIPAL_NAME}
[12332] 1504171391.121253: Getting initial credentials for ${PRINCIPAL_NAME}
[12332] 1504171391.123940: Looked up etypes in keytab: des, des-cbc-crc, aes128-cts, rc4-hmac, aes256-cts, des3-cbc-sha1
[12332] 1504171391.124027: Sending request (227 bytes) to ${DOMAIN}
[12332] 1504171391.124613: Resolving hostname localhost
[12332] 1504171391.124988: Sending initial UDP request to dgram ::1:1088
[12332] 1504171391.125070: Sending initial UDP request to dgram 127.0.0.1:1088
[12332] 1504171391.125120: Initiating TCP connection to stream ::1:1088
[12332] 1504171391.125165: Terminating TCP connection to stream ::1:1088
[12332] 1504171391.125186: Initiating TCP connection to stream 127.0.0.1:1088
[12332] 1504171391.125216: Terminating TCP connection to stream 127.0.0.1:1088
kinit: Cannot contact any KDC for realm '${DOMAIN}' while getting initial credentialsssh -vvv重新尝试
debug1:连接到端口1088,请求转发到本地主机端口88。debug2: fd 15设置TCP_NODELAY debug2: fd 15设置O_NONBLOCK debug3: fd 15是O_NONBLOCK debug1:通道7:新的直接tcpip debug3:发送数据包:类型90 debug1:连接端口1088,转发到请求的本地主机端口88。debug2: fd 16设置TCP_NODELAY debug2: fd 16设置O_NONBLOCK debug3: fd 16 is O_NONBLOCK debug1: channel 8:新的直接tcpip debug3:发送数据包:类型90我尝试了tcpdump,在本地有尝试连接,但找不到任何收到的包到另一个网站。
我编辑krb5.conf中的所有其他信息。
我在这里错过了什么,还是这一切都有可能?
PS:netstat说端口在这两台机器上都是存在和打开的。我对服务器本身的kinit没有问题。
据我所见,kdc实际上是在udp 88端口监听,而不是tcp,这会是一个问题吗?
发布于 2017-08-31 14:36:25
我最终通过使用socat和ssh解决了这个问题,如下所示,以及几个教程:
我们正在将udp包接收到1088,但是ssh隧道只有tcp,因此使用socat我们可以“转换”它们:
locally$ socat -T15 udp4-recvfrom:1088,reuseaddr,fork tcp:localhost:1089现在,我们通过以下方法创建该端口的ssh隧道到远程服务器
locally$ ssh -L1089:localhost:1089 remote_server之后,我们将到达1089的tcp包转换为udp,并将它们重定向到88 vie端口的kdc。
server$ socat tcp4-listen:1088,reuseaddr,fork UDP:localhost:88发布于 2019-01-30 06:46:48
您可以强制kerberos只使用tcp,而不必对UDP通信量进行隧道操作,如下所示:
[realms]
MY.REALM = {
kdc = tcp/localhost:1088
master_kdc = tcp/localhost:1088
admin_server = tcp/localhost:1749
}现在,像前面一样设置tcp/ssh隧道:
ssh -L1088:kdc.server:88 -L1749:kdc.server:749 ssh.hophttps://stackoverflow.com/questions/45978328
复制相似问题