Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

id_rsa.pub location when adding host using SSH Auth #478

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

daniftodi
Copy link

@daniftodi daniftodi commented Feb 8, 2025

Currently the path of the id_rsa.pub file that should be added to the /root/.ssh/authorized_hosts isn't correct for CloudStack 4.20.0, see: https://docs.cloudstack.apache.org/en/4.20.0.0/installguide/configuration.html

Based on commit: apache/cloudstack@8952cd5

the key is located at: /var/lib/cloudstack/management/.ssh/id_rsa.pub

Verified on CloudStack 4.20.0 during the initial setup for CloudStack.

Screenshot from 2025-02-08 15-21-31


📚 Documentation preview 📚: https://cloudstack-documentation--478.org.readthedocs.build/en/478/

@weizhouapache
Copy link
Member

👍

the home of cloud user is different on ubuntu and RHEL, so the correct location should be ~cloud/.ssh/id_rsa.pub
@daniftodi

@daniftodi
Copy link
Author

👍

the home of cloud user is different on ubuntu and RHEL, so the correct location should be ~cloud/.ssh/id_rsa.pub @daniftodi

Thank you for approving this, I can't merge, probably will be merged by someone with write access.

Isn't the username a configuration passed on the Username field during the configuration of a host?

@DaanHoogland
Copy link
Contributor

👍
the home of cloud user is different on ubuntu and RHEL, so the correct location should be ~cloud/.ssh/id_rsa.pub @daniftodi

does this mean we need to adjust the text still more @weizhouapache ?

Thank you for approving this, I can't merge, probably will be merged by someone with write access.

Isn't the username a configuration passed on the Username field during the configuration of a host?

good point @daniftodi , but I have never seen an installation using anything but the default. could be a good test ;)

@@ -493,7 +493,7 @@ Basic Zone Configuration

Before adding the host in CloudStack do the following,

- Copy the SSH public key from /var/cloudstack/management/.ssh/id_rsa.pub on the management server
- Copy the SSH public key from /var/lib/cloudstack/management/.ssh/id_rsa.pub on the management server
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Copy the SSH public key from /var/lib/cloudstack/management/.ssh/id_rsa.pub on the management server
- Copy the SSH public key from ~cloud/.ssh/id_rsa.pub on the management server

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a valid, ~cloud/.ssh/id_rsa.pub - doesn't exist. Who should create it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the cloud user is created by cloudstack.

I tested on two management servers.
the cloud users have different home directories on ubuntu and rocky. This is why I suggested.

  • ubuntu 24.04
# ls -l ~cloud/.ssh/id_rsa.pub 
-rw-r--r-- 1 cloud cloud 594 Mar 14 16:19 /var/lib/cloudstack/management/.ssh/id_rsa.pub
  • rocky8
# ls -l ~cloud/.ssh/id_rsa.pub 
-rw-r--r--. 1 cloud cloud 202 Mar 14 10:14 /var/cloudstack/management/.ssh/id_rsa.pub

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @weizhouapache 's suggestion is valid. We could add a remark that "the actual user may differ depending on your configuration".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants