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

Update gen-keypair-ubuntu.sh to update authorized_keys #518

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

Conversation

KeitaW
Copy link
Collaborator

@KeitaW KeitaW commented Dec 26, 2024

IHAC who accidentally remove contents in authorized_keys after cluster setup. That caused

2024-12-26T09:09:03.929Z
Generate a new keypair...
2024-12-26T09:09:04.180Z
+ ssh-keygen -t rsa -q -f id_rsa -N ‘’
2024-12-26T09:09:04.180Z
id_rsa already exists.
2024-12-26T09:09:04.430Z
Overwrite (y/n)? Traceback (most recent call last): File “lifecycle_script.py”, line 232, in <module> main(args) File “lifecycle_script.py”, line 185, in main ExecuteBashScript(“./utils/gen-keypair-ubuntu.sh”).run() File “lifecycle_script.py”, line 31, in run result.check_returncode() File “/usr/lib/python3.8/subprocess.py”, line 448, in check_returncode raise CalledProcessError(self.returncode, self.args, self.stdout,
2024-12-26T09:09:08.979Z
subprocess.CalledProcessError: Command ’[’sudo’, ‘bash’, ‘./utils/gen-keypair-ubuntu.sh’]' returned non-zero

when they tried to add a new node as GENERATE_KEYPAIR=1 when we don't have the contents of id_rsa.pub in authorized_keys, even when the key pair does exist.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

IHAC who accidentally remove `authorized_keys` after cluster setup. That caused
```
2024-12-26T09:09:03.929Z
Generate a new keypair...
2024-12-26T09:09:04.180Z
+ ssh-keygen -t rsa -q -f id_rsa -N ‘’
2024-12-26T09:09:04.180Z
id_rsa already exists.
2024-12-26T09:09:04.430Z
Overwrite (y/n)? Traceback (most recent call last): File “lifecycle_script.py”, line 232, in <module> main(args) File “lifecycle_script.py”, line 185, in main ExecuteBashScript(“./utils/gen-keypair-ubuntu.sh”).run() File “lifecycle_script.py”, line 31, in run result.check_returncode() File “/usr/lib/python3.8/subprocess.py”, line 448, in check_returncode raise CalledProcessError(self.returncode, self.args, self.stdout,
2024-12-26T09:09:08.979Z
subprocess.CalledProcessError: Command ’[’sudo’, ‘bash’, ‘./utils/gen-keypair-ubuntu.sh’]' returned non-zero
```
when they tried to add a new node as `GENERATE_KEYPAIR=1` when we don't have the contents of `id_rsa.pub` in `authorized_keys`, even when the key pair does exist.
@KeitaW KeitaW requested a review from sean-smith December 26, 2024 09:47
@KeitaW KeitaW self-assigned this Dec 26, 2024
Copy link
Contributor

@mhuguesaws mhuguesaws left a comment

Choose a reason for hiding this comment

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

Left comments

…fig/utils/gen-keypair-ubuntu.sh

Co-authored-by: mhuguesaws <[email protected]>
@KeitaW
Copy link
Collaborator Author

KeitaW commented Jan 11, 2025

Thanks @mhuguesaws

@KeitaW KeitaW requested a review from mhuguesaws January 11, 2025 01:23
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.

2 participants