Permissions fix for agent creating /root/.ssh /root/.ssh is created with perms '600' if it doesn't already exist. This causes a problem in that it can't write out id_rsa.cloud:
2012-08-27 16:35:40,227 DEBUG [cloud.agent.Agent] (agentRequest-Handler-4:null) Processing command: com.cloud.agent.api.ModifySshKeysCommand 2012-08-27 16:35:40,228 DEBUG [kvm.resource.LibvirtComputingResource] (agentRequest-Handler-4:null) Failed to create file: java.io.IOException: Permission denied Doing 'chmod u+x /root/.ssh' fixed the above, so it seems that even though the agent is running as root it cares about being able to chdir into /root.ssh Signed-off-by: Sheng Yang <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/537c29c2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/537c29c2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/537c29c2 Branch: refs/heads/javelin Commit: 537c29c2fa43651582efdd42c02d6f34de2f5ecf Parents: fe8a299 Author: Marcus Sorensen <[email protected]> Authored: Wed Sep 12 15:48:33 2012 -0700 Committer: Sheng Yang <[email protected]> Committed: Wed Sep 12 15:48:33 2012 -0700 ---------------------------------------------------------------------- .../kvm/resource/LibvirtComputingResource.java | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/537c29c2/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java index ff2b950..ad2b07b 100755 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java @@ -2620,9 +2620,9 @@ public class LibvirtComputingResource extends ServerResourceBase implements String result = null; if (!sshKeysDir.exists()) { sshKeysDir.mkdir(); - // Change permissions for the 600 + // Change permissions for the 700 Script script = new Script("chmod", _timeout, s_logger); - script.add("600", _SSHKEYSPATH); + script.add("700", _SSHKEYSPATH); script.execute(); }
