[Bug 1645555] Re: Dropbear initramfs hook creates authorized_keys file in an invalid folder

2018-07-30 Thread Ibrahim Karahan
Still exists on Ubuntu 18.04:

$ sudo lsinitramfs /boot/initrd.img-4.15.0-29-generic  | grep root
root-Fc4un7
root-Fc4un7/.ssh
root-Fc4un7/.ssh/authorized_keys

The temp folder created with "$DESTDIR/root-XX" scheme is garbage.
It's never renamed to /root folder, thus Dropbear fails to find the
authorized_keys file.

The workaround in #1 still works.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/164

Title:
  Dropbear initramfs hook creates authorized_keys file in an invalid
  folder

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/dropbear/+bug/164/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1645555] [NEW] Dropbear initramfs hook creates authorized_keys file in an invalid folder

2016-11-28 Thread Ibrahim Karahan
Public bug reported:

Dropbear initramfs hook copies `/etc/initramfs-
tools/root/.ssh/authorized_keys` into initramfs for passwordless login
during boot.

The script responsible is `/usr/share/initramfs-tools/hooks/dropbear`.
The destination folder is set at line 37:

`home=$(mktemp -d "$DESTDIR/root-XX")`

which ends up creating a temp directory in initramfs file, similar to
`/root-hZQ48a`, instead of `/root`. Dropbear fails to find
`/root/.ssh/authorized_keys` at boot and does not allow remote logins.

See the contents of a generated initrd with:
`cd `mktemp -d` && gzip -dc /boot/initrd.img-`uname -r` | cpio -ivd`

Setting the $home variable with the following lines should solve the issue:
```
home="$DESTDIR/root"
mkdir -p $home
```

** Affects: dropbear (Ubuntu)
 Importance: Undecided
 Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/164

Title:
  Dropbear initramfs hook creates authorized_keys file in an invalid
  folder

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/dropbear/+bug/164/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs