Chef-Cygwin-Windows-将ssh密钥添加到授权密钥

时间:2018-07-06 10:45:25

标签: windows powershell cygwin chef

嗨,我正在尝试通过厨师食谱将ssh密钥添加到Windows VM中的授权密钥文件中。但是由于失败而导致权限被拒绝的错误。

enter image description here

然后我尝试添加powershell脚本资源来设置文件夹的权限

String text = "hello, What you are doing?How are you?";
        String[] arr= text.split("[\\.,!;?:\"]+");

        for (String str : arr) {
            System.out.println(str);
        }

但仍然会给出相同的错误

enter image description here

这是添加ssh密钥的块

powershell_script 'change file permission' do
            guard_interpreter :powershell_script
            code "C:/cygwin/bin/chmod 777 C:/cygwin/home/Administrator/.ssh"
                          end

          powershell_script 'change authorized key file permission' do
            guard_interpreter :powershell_script
            code "C:/cygwin/bin/chmod 777 C:/cygwin/home/Administrator/.ssh/authorized_keys"

          end

您知道如何解决此问题吗?

0 个答案:

没有答案