Update Post Installation SSH Password Disable Steps - #1074
Conversation
|
|
||
| ```sh | ||
| cat <<EOF | kubectl apply -f - | ||
| cat <<EOF | sudo env "PATH=$PATH" /var/lib/rancher/rke2/bin/kubectl --kubeconfig=/etc/rancher/rke2/rke2.yaml apply -f - |
There was a problem hiding this comment.
Why not simply use sudo su to become root, then you can execute kubectl without issues.
Please keep the previous text.
| cat <<EOF | sudo env "PATH=$PATH" /var/lib/rancher/rke2/bin/kubectl --kubeconfig=/etc/rancher/rke2/rke2.yaml apply -f - | |
| cat <<EOF | kubectl apply -f - |
There was a problem hiding this comment.
In my testing, kubectl wasn't in the root user's PATH.
There was a problem hiding this comment.
Hi @alexfornuto,
It should be in the root's PATH, see below:
# echo $PATH
/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/var/lib/rancher/rke2/bin
# ls /var/lib/rancher/rke2/bin
containerd containerd-shim-runc-v2 crictl ctr kubectl kubelet runc
Could you give the result of your PATH environment variable with the following command?
echo $PATH
There was a problem hiding this comment.
No, I can't, since I've already moved on from Harvester and have no more environments. I presume y'all have test environments to play with?
EDIT: Perhaps the issue wasn't with $PATH specifically. have you tried invoking kubectl as the rancher user with sudo?
Vicente-Cheng
left a comment
There was a problem hiding this comment.
overall lgtm, just some nit
|
hi @alexfornuto, |
Comments reviewed, changes applied or comments addressed. Feel free to make additional changes required directly to the PR itself. |
Thanks @alexfornuto, |
The instructions for disabling SSH password auth were incorrect in a few different ways; there is no `sshd_config` file, `kubectl` isn't in the `root` user's path, etc etc... This is what worked for me, but I reckon someone at SUSE should perform a more holistic review of these pages. Signed-off-by: Alex Fornuto <2349184+alexfornuto@users.noreply.github.com>
Signed-off-by: Alex Fornuto <2349184+alexfornuto@users.noreply.github.com>
Signed-off-by: Alex Fornuto <2349184+alexfornuto@users.noreply.github.com>
Problem:
The instructions for disabling SSH password auth were incorrect in a few different ways; there is no
sshd_configfile,kubectlisn't in therootuser's path, etc etc...Solution:
This is what worked for me, but I reckon someone at SUSE should perform a more holistic review of these pages.
Related Issue(s):
Issue harvester/harvester#11126
Test plan:
Do the steps, dawg.
Additional documentation or context