All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [RFC] openssh: add option to allow login as root
@ 2019-03-19 11:41 Esben Haabendal
  2019-03-19 15:23 ` Grant Edwards
  2019-03-19 22:42 ` Peter Korsgaard
  0 siblings, 2 replies; 10+ messages in thread
From: Esben Haabendal @ 2019-03-19 11:41 UTC (permalink / raw)
  To: buildroot

From: Esben Haabendal <esben@haabendal.dk>

What do you think. Is this kind of micro-management of a configuration
file something that I should keep out of tree?

/Esben
---
 package/openssh/Config.in  | 10 ++++++++++
 package/openssh/openssh.mk |  7 +++++++
 2 files changed, 17 insertions(+)

diff --git a/package/openssh/Config.in b/package/openssh/Config.in
index 683a9c0e5191..bc4f40efa3de 100644
--- a/package/openssh/Config.in
+++ b/package/openssh/Config.in
@@ -9,3 +9,13 @@ config BR2_PACKAGE_OPENSSH
 	  friends.
 
 	  http://www.openssh.com/
+
+if BR2_PACKAGE_OPENSSH
+
+config BR2_PACKAGE_OPENSSH_PERMIT_ROOT_LOGIN
+	bool "Allow SSH root login"
+	help
+	  Modify SSH server configuration to allow login as root.
+	  Warning: This might not be a good idea.  Use at own risk!
+
+endif
diff --git a/package/openssh/openssh.mk b/package/openssh/openssh.mk
index 4fef5caedb01..8d1c153a8752 100644
--- a/package/openssh/openssh.mk
+++ b/package/openssh/openssh.mk
@@ -88,4 +88,11 @@ endef
 
 OPENSSH_POST_INSTALL_TARGET_HOOKS += OPENSSH_INSTALL_SSH_COPY_ID
 
+ifeq ($(BR2_PACKAGE_OPENSSH_PERMIT_ROOT_LOGIN),y)
+define OPENSSH_INSTALL_PERMIT_ROOT_LOGIN
+	$(SED) 's/\#PermitRootLogin prohibit-password/PermitRootLogin yes/' $(TARGET_DIR)/etc/ssh/sshd_config
+endef
+OPENSSH_POST_INSTALL_TARGET_HOOKS += OPENSSH_INSTALL_PERMIT_ROOT_LOGIN
+endif
+
 $(eval $(autotools-package))
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-03-20 16:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-19 11:41 [Buildroot] [RFC] openssh: add option to allow login as root Esben Haabendal
2019-03-19 15:23 ` Grant Edwards
2019-03-19 22:42 ` Peter Korsgaard
2019-03-20  0:23   ` Arnout Vandecappelle
2019-03-20  8:58     ` Peter Korsgaard
2019-03-20  9:05       ` James Hilliard
2019-03-20  9:23         ` Arnout Vandecappelle
2019-03-20  9:26         ` Yann E. MORIN
2019-03-20  9:32           ` James Hilliard
2019-03-20 16:25     ` Carlos Santos

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.