R Shell 和 Kerberos 票证
R Shell and Kerberos Ticket
我在 RStudio 中通过 JDBC 建立了一个配置单元连接,没有问题,我在 Tools < Shell: kinit
中创建了 Kerberos 票证并且一切正常,我可以使用 Kerberos TGT。
但是,如果我通过 shell/ssh 执行相同的方法并在终端(不是 RStudio)中加载 R,则 R 无法使用 Kerberos TGT 文件并失败。
如何使用 Kerberos 票证?
> [user@server ~]$: kinit
>
> Password for user@domain: --i put the password--
>
> [user@server ~]$: R
>
> -- R load --
>
> \> source('samecode.r')
>
> Error Caused by: java.sql.SQLException: Could not create secure connection to jdbc:hive2:....etc
有什么想法吗?如果我们不创建票证,RStudio 中会发生此错误,但在工具>shell 中创建时一切正常,在控制台中是不可能的。
我尝试用
创建它
system('kinit');
并且可以很好地创建票证,但不能在其余代码中使用它。
您好,您可以使用 keytab
文件和此命令在 R 中创建一个 kerberos 票证:
system("kinit username@ADS.IU.EDU -k -t username.keytab")
要创建 keytab
,您必须通过 shell 执行此操作:
ktutil
ktutil: addent -password -p username@ADS.IU.EDU -k 1 -e rc4-hmac
Password for username@ADS.IU.EDU: [enter your password]
ktutil: addent -password -p username@ADS.IU.EDU -k 1 -e aes256-cts
Password for username@ADS.IU.EDU: [enter your password]
ktutil: wkt username.keytab
ktutil: quit
解释了创建 keytab
的所有步骤 here
并且 keytab
文件必须在您的工作目录中。
我在 RStudio 中通过 JDBC 建立了一个配置单元连接,没有问题,我在 Tools < Shell: kinit
中创建了 Kerberos 票证并且一切正常,我可以使用 Kerberos TGT。
但是,如果我通过 shell/ssh 执行相同的方法并在终端(不是 RStudio)中加载 R,则 R 无法使用 Kerberos TGT 文件并失败。
如何使用 Kerberos 票证?
> [user@server ~]$: kinit
>
> Password for user@domain: --i put the password--
>
> [user@server ~]$: R
>
> -- R load --
>
> \> source('samecode.r')
>
> Error Caused by: java.sql.SQLException: Could not create secure connection to jdbc:hive2:....etc
有什么想法吗?如果我们不创建票证,RStudio 中会发生此错误,但在工具>shell 中创建时一切正常,在控制台中是不可能的。 我尝试用
创建它 system('kinit');
并且可以很好地创建票证,但不能在其余代码中使用它。
您好,您可以使用 keytab
文件和此命令在 R 中创建一个 kerberos 票证:
system("kinit username@ADS.IU.EDU -k -t username.keytab")
要创建 keytab
,您必须通过 shell 执行此操作:
ktutil
ktutil: addent -password -p username@ADS.IU.EDU -k 1 -e rc4-hmac
Password for username@ADS.IU.EDU: [enter your password]
ktutil: addent -password -p username@ADS.IU.EDU -k 1 -e aes256-cts
Password for username@ADS.IU.EDU: [enter your password]
ktutil: wkt username.keytab
ktutil: quit
解释了创建 keytab
的所有步骤 here
并且 keytab
文件必须在您的工作目录中。