Try to replace dropbear by openssh-server using imagebuilder #9
No reviewers
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Sysdeploy/openwrt#9
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "lee.miller/openwrt:openssh"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi!
This is a possible simple solution for #5
1f284ec032
to15b8d70716
Ok but a couple of issues.
Doesn't accept root password. Which I don't want anyway, but I'd also like to disable password authentication explicitly in
/etc/ssh/sshd_config
I want to populate default
authorized_keys
756a744c4f
toc1e61f67ee
The PR looks promising, let me test it.
Something weird is happening when trying to boot this.
dmesg
shows that the /tmp/overlay can't be mounted, and without the overlay the system doesn't work properly. I can login via console but nothing works properly. It's as if the image was corrupt or something. I flashed the microSD card both on a mac and linux and I get the same result.After further testing, it looks to be some filesystem weirdness. I modify distroconfig.txt to enable the USB, as otherwise I can't use the keyboard. If I do this before first boot, the root filesystem gets screwed up or something. So I have to boot first, then power down, edit distroconfig.txt (on another machine) and then put the SD card back into the device and boot again.
Now regarding openssh:
/etc/uci-defaults/99-custom
is executed upon each boot. Maybe then as a last step, it should remove itself?PermitRootLogin no
should be replaced withPasswordAuthentication no
authorized_keys
don't get deployed and there is no /root/.ssh directory. I'm not sure~
will work inside the uci-defaults script but maybe I'm wrongc1e61f67ee
to33cf5864e1
It seems to be set by default, at least
staging_dir/target-aarch64_cortex-a72_musl/root-bcm27xx/etc/ssh/sshd_config
has it uncommented. There is alsoPermitRootLogin prohibit-password
mentioned as default.The doc says: If they exit with code 0 they are deleted afterwards.
When I boot it,
sshd_config
hasPasswordAuthentication
commented. If I try to ssh in like that, it's asking for password. If I manually addPasswordAuthentication no
, then it doesn't ask for password (i.e. and only checks keys).It looks like the other default files are deleted upon first boot, just the 99-custom stays there. Why? Don't know. Maybe
/sbin
isn't in PATH soservice
doesn't resolve?@ -50,0 +53,4 @@
mkdir -p files/etc/uci-defaults
cat << "EOF" > files/etc/uci-defaults/99-custom
echo "PasswordAuthentication no" >> /etc/ssh/sshd_config
mkdir -p ~/.ssh
this works now, but
~
is/
@ -50,0 +54,4 @@
cat << "EOF" > files/etc/uci-defaults/99-custom
echo "PasswordAuthentication no" >> /etc/ssh/sshd_config
mkdir -p ~/.ssh
mv authorized_keys ~/.ssh/
I think this is not run. Maybe it's about the current directory?
04a7a3bb64
to9e2394be2b
Looks ok, I'll be able to test on Tuesday.
key is now in the right location. The permissions are too loose though. Can we maybe put it into the subdirectories into
files
? Likefiles/root/.ssh/authorized_keys
? Then you can skip themkdir
andmv
regarding sshd, debugging revealed that
enable
, but do need torestart
instead ofstart
/sbin/service
and not justservice
9e2394be2b
to2f3be6009c
Ok it works except he permissions for /root/.ssh and /root/.ssh/authorized keys should be more restrictive. I'll merge, you can fix it in a separate PR.