LinuxConfiguration
でプロパティを設定できますOSProfile
。サンプルコードは次のとおりです。
// Set up SSH public key
String fullStorePath = " ~/.ssh/authorized_keys";
String sshKeyData = "you-ssh-key-data";
SshPublicKey sshPublicKey = new SshPublicKey();
sshPublicKey.setPath(fullStorePath);
sshPublicKey.setKeyData(sshKeyData);
// SShConfiguration
ArrayList<SshPublicKey> keyList = new ArrayList<SshPublicKey>();
keyList.add(sshPublicKey);
SshConfiguration sshConfig = new SshConfiguration();
sshconfig.setPublicKeys(keyList);
// Linux Configuration
Bool shouldDisablePasswordAuthentication = False;
LinuxConfiguration linuxConfig = new LinuxConfiguration();
linuxConfig.setSsh(sshConfig);
linuxConfig.setDisablePasswordAuthentication(shouldDisablePasswordAuthentication);
// set your OSProfile now
request.getOsProfile().setLinuxConfiguration(linuxConfig);
// you code goes here