Project

General

Profile

Bug #53335

"cephadm bootstrap --ssh-user" doesn't support non root user

Added by Guillaume Abrioux over 2 years ago. Updated about 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Typical error thrown:

[root@vm ~]# ./cephadm bootstrap --mon-ip 192.168.121.115 --ssh-private-key /home/guits/.ssh/id_rsa --ssh-user guits --skip-dashboard --skip-monitoring-stack 
This is a development version of cephadm.
For information regarding the latest stable release:
    https://docs.ceph.com/docs/pacific/cephadm/install
Creating directory /etc/ceph for ceph.conf
Verifying podman|docker is present...
Verifying lvm2 is present...

....

Setting orchestrator backend to cephadm...
Generating ssh key...
Wrote public SSH key to /etc/ceph/ceph.pub
Adding key to guits@localhost authorized_keys...
Adding host vm...
Non-zero exit code 22 from /bin/podman run --rm --ipc=host --stop-signal=SIGTERM --net=host --entrypoint /usr/bin/ceph --init -e CONTAINER_IMAGE=quay.ceph.io/ceph-ci/ceph:master -e NODE_NAME=vm -e CEPH_USE_RANDOM_NONCE=1 -v /var/log/ceph/7afb1d12-491e-11ec-8e58-525400387448:/var/log/ceph:z -v /tmp/ceph-tmpdq6pdn_2:/etc/ceph/ceph.client.admin.keyring:z -v /tmp/ceph-tmp5jp4lug4:/etc/ceph/ceph.conf:z quay.ceph.io/ceph-ci/ceph:master orch host add vm 192.168.121.115
/usr/bin/ceph: stderr Error EINVAL: check-host failed:
/usr/bin/ceph: stderr Unable to write vm:/var/lib/ceph/7afb1d12-491e-11ec-8e58-525400387448/cephadm.e92213b10861461d4a5831d29bf7b45767037d0097bd8c7a2212263343bbf683: scp: /var/lib/ceph/7afb1d12-491e-11ec-8e58-525400387448/cephadm.e92213b10861461d4a5831d29bf7b45767037d0097bd8c7a2212263343bbf683.new: Permission denied
ERROR: Failed to add host <vm>: Failed command: /bin/podman run --rm --ipc=host --stop-signal=SIGTERM --net=host --entrypoint /usr/bin/ceph --init -e CONTAINER_IMAGE=quay.ceph.io/ceph-ci/ceph:master -e NODE_NAME=vm -e CEPH_USE_RANDOM_NONCE=1 -v /var/log/ceph/7afb1d12-491e-11ec-8e58-525400387448:/var/log/ceph:z -v /tmp/ceph-tmpdq6pdn_2:/etc/ceph/ceph.client.admin.keyring:z -v /tmp/ceph-tmp5jp4lug4:/etc/ceph/ceph.conf:z quay.ceph.io/ceph-ci/ceph:master orch host add vm 192.168.121.115
[root@vm ~]#

History

#1 Updated by Sebastian Wagner over 2 years ago

turns out

https://github.com/ceph/ceph/blob/93054a3fa9465d2fad038924489df10ff4bf89d2/src/pybind/mgr/cephadm/ssh.py#L200

failes, cause we cannot write to the file as asyncssh.scp does not support sudo. Instead we have to write the .new file to /tmp and then move it to the final destination using sudo mv.

#2 Updated by Melissa Li over 2 years ago

  • Assignee set to Melissa Li

#3 Updated by Melissa Li over 2 years ago

  • Pull request ID set to 44093

#4 Updated by Sebastian Wagner over 2 years ago

  • Status changed from New to Fix Under Review

#5 Updated by Sebastian Wagner about 2 years ago

  • Status changed from Fix Under Review to Resolved

Also available in: Atom PDF