Skip to content

Commit

Permalink
openssh: add UCI support
Browse files Browse the repository at this point in the history
* update init script to handle sshd UCI by generating config file
  and passing that config file to the sshd daemon
* add a default sshd config
* add uci-default script that tries to migrate dropbear config
  and authorized_keys file to sshd

Signed-off-by: Mohd Husaam Mehdi <husaam.mehdi@iopsys.eu>
  • Loading branch information
mhusaam committed May 12, 2024
1 parent 42140c6 commit 1032511
Show file tree
Hide file tree
Showing 4 changed files with 528 additions and 10 deletions.
4 changes: 4 additions & 0 deletions net/openssh/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,14 @@ define Package/openssh-server/install
sed -r -i 's,^#(HostKey /etc/ssh/ssh_host_(rsa|ed25519)_key)$$$$,\1,' $(1)/etc/ssh/sshd_config
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/sshd.init $(1)/etc/init.d/sshd
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_BIN) ./files/sshd.config $(1)/etc/config/sshd
$(INSTALL_DIR) $(1)/lib/preinit
$(INSTALL_BIN) ./files/sshd.failsafe $(1)/lib/preinit/99_10_failsafe_sshd
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/sshd $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DATA) ./files/sshd.ucidefault $(1)/etc/uci-defaults/99-generate-sshd-config
endef

define Package/openssh-server-pam/install
Expand Down
6 changes: 6 additions & 0 deletions net/openssh/files/sshd.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
config sshd
option enable '1'
option Port '22'
option RootLogin '1'
option PasswordAuth '1'
option RootPasswordAuth '1'
Loading

0 comments on commit 1032511

Please sign in to comment.