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

Log in as root #58

Merged
merged 5 commits into from
Feb 19, 2024
Merged

Log in as root #58

merged 5 commits into from
Feb 19, 2024

Conversation

orelmisan
Copy link
Member

@orelmisan orelmisan commented Feb 15, 2024

Currently, the checkup creates a cloud-user user using cloud-init, and logs in to the VM using its credentials.
Immediately after logging in, the checkup issues the sudo su command, thus effectively running as the root user.

Logging in as root simplifies the login operation, and remove problems that can occur when certain assumptions are made when performing the sudo su step - for example:

  1. Not expecting the sudo warning message
  2. Not expecting to enter the user's password again.

Also remove the creation of cloud-user volume, since it is no longer needed.

Based on work done in kiagnose/kubevirt-dpdk-checkup#225.

Currently, when logging in as root - the login operation
fails because of a mistake in the directory name expected by
`loggedInPromptRegex`.

Signed-off-by: Orel Misan <[email protected]>
Currently, the checkup creates a `cloud-user` user
using cloud-init, and logs in to the VMs using its
credentials.
Immediately after logging in, the checkup issues the
`sudo su` command, thus effectively running as the root user.

Logging in as root simplifies the login operation, and remove
problems that can occur when certain assumptions are made when
performing the `sudo su` step - for example:
1. Not expecting the sudo warning message
2. Not expecting to enter the user's password again.

Also remove the creation cloud-init volume, since
it is no longer needed.

Signed-off-by: Orel Misan <[email protected]>
`configureConsole` is only used in login.go.

Signed-off-by: Orel Misan <[email protected]>
Since we log in as root, there is no need to have
support for sudo.

Signed-off-by: Orel Misan <[email protected]>
Since we only log in as `root` - simply `LoginToCentOS`
and rename it to match its abilities.

Signed-off-by: Orel Misan <[email protected]>
@orelmisan
Copy link
Member Author

Tested against an OpenShift Virtualization 4.15 cluster.

Copy link
Collaborator

@RamLavi RamLavi left a comment

Choose a reason for hiding this comment

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

/lgtm

@orelmisan orelmisan merged commit 4dfe5e3 into kiagnose:main Feb 19, 2024
5 checks passed
@orelmisan orelmisan deleted the root-login branch February 19, 2024 16:33
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