Skip to content

Commit d9c429f

Browse files
authored
Merge pull request ceph#62507 from NVShawn/main
[Packaging]: Use system-defined location for home directories
2 parents 8ce2e9e + 9075b17 commit d9c429f

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

debian/cephadm.postinst

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ case "$1" in
2828
adduser --quiet \
2929
--system \
3030
--disabled-password \
31-
--home /home/cephadm \
3231
--shell /bin/bash cephadm 2>/dev/null || true
3332
usermod --comment "cephadm user for mgr/cephadm" cephadm
3433
echo "..done"
@@ -42,15 +41,15 @@ case "$1" in
4241
fi
4342

4443
# set up (initially empty) .ssh/authorized_keys file
45-
if ! test -d /home/cephadm/.ssh; then
46-
mkdir /home/cephadm/.ssh
47-
chown --reference /home/cephadm /home/cephadm/.ssh
48-
chmod 0700 /home/cephadm/.ssh
44+
if ! test -d ~cephadm/.ssh; then
45+
mkdir ~cephadm/.ssh
46+
chown --reference ~cephadm ~cephadm/.ssh
47+
chmod 0700 ~cephadm/.ssh
4948
fi
50-
if ! test -e /home/cephadm/.ssh/authorized_keys; then
51-
touch /home/cephadm/.ssh/authorized_keys
52-
chown --reference /home/cephadm /home/cephadm/.ssh/authorized_keys
53-
chmod 0600 /home/cephadm/.ssh/authorized_keys
49+
if ! test -e ~cephadm/.ssh/authorized_keys; then
50+
touch ~cephadm/.ssh/authorized_keys
51+
chown --reference ~cephadm ~cephadm/.ssh/authorized_keys
52+
chmod 0600 ~cephadm/.ssh/authorized_keys
5453
fi
5554

5655
;;

doc/cephadm/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ available options.
260260

261261
* The ``--ssh-user *<user>*`` option makes it possible to designate which SSH
262262
user cephadm will use to connect to hosts. The associated SSH key will be
263-
added to ``/home/*<user>*/.ssh/authorized_keys``. The user that you
263+
added to ``~*<user>*/.ssh/authorized_keys``. The user that you
264264
designate with this option must have passwordless sudo access.
265265

266266
* If you are using a container image from a registry that requires

0 commit comments

Comments
 (0)