GNU bug report logs - #49430
[PATCH] doc: Add auto login to tty guide to the cookbook.

Previous Next

Package: guix-patches;

Reported by: Joshua Branson <jbranso <at> dismail.de>

Date: Tue, 6 Jul 2021 06:21:02 UTC

Severity: normal

Tags: patch

Done: Leo Prikler <leo.prikler <at> student.tugraz.at>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 49430 <at> debbugs.gnu.org (full text, mbox):

From: Joshua Branson <jbranso <at> dismail.de>
To: 49430 <at> debbugs.gnu.org
Cc: Joshua Branson <jbranso <at> gnucode.me>, leo.prikler <at> student.tugraz.at
Subject: [PATCH] doc: Add auto login to tty guide to the cookbook.
Date: Tue,  6 Jul 2021 04:08:56 -0400
From: Joshua Branson <jbranso <at> gnucode.me>

* doc/guix-cookbook.texi (System Configuration): Add a brief guide that
explains auto login to a TTY.  This is a follow up to bug 48974.
---
 doc/guix-cookbook.texi | 45 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 44 insertions(+), 1 deletion(-)

diff --git a/doc/guix-cookbook.texi b/doc/guix-cookbook.texi
index 1cddaa7faf..85489e1a93 100644
--- a/doc/guix-cookbook.texi
+++ b/doc/guix-cookbook.texi
@@ -17,6 +17,7 @@ Copyright @copyright{} 2020 Marcin Karpezo@*
 Copyright @copyright{} 2020 Brice Waegeneire@*
 Copyright @copyright{} 2020 André Batista@*
 Copyright @copyright{} 2020 Christopher Lemmer Webber
+Copyright @copyright{} 2021 Joshua Branson@*
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -85,7 +86,7 @@ Packaging
 
 System Configuration
 
-* Customizing the Kernel::      Creating and using a custom Linux kernel
+* Auto Login a User to a Specific TTY::   Automatically Login a User to a Specific TTY
 
 
 @end detailmenu
@@ -1353,6 +1354,7 @@ chapter is to demonstrate some advanced configuration concepts.
 reference.
 
 @menu
+* Auto Login a User to a Specific TTY::   Automatically Login a User to a Specific TTY
 * Customizing the Kernel::       Creating and using a custom Linux kernel on Guix System.
 * Guix System Image API::        Customizing images to target specific platforms.
 * Connecting to Wireguard VPN::  Connecting to a Wireguard VPN.
@@ -1363,6 +1365,47 @@ reference.
 * Setting up NGINX with Lua:: Configuring NGINX web-server to load Lua modules.
 @end menu
 
+@node Auto Login a User to a Specific TTY
+@section Auto Login a User to a Specific TTY
+
+Guix System currently offers auto login to a tty via @code{mingetty},
+but a newcomer to Guix System may be unfamiliar with setting up auto
+login.  First, a note of caution.  Setting up auto login to a tty, means
+that anyone can turn on your computer and run commands as your regular
+user. If you have encrypted your @code{/} partition, and thus need to
+enter in a passphrase at boot, then perhaps auto login is a secure and
+convenient option for you.
+
+Here is how one might go about setting up auto login to a tty:
+
+@lisp
+(define (auto-login-to-tty config tty user)
+  (if (string=? tty (mingetty-configuration-tty config))
+        (mingetty-configuration
+         (inherit config)
+         (auto-login user))
+        config))
+
+(define %my-base-services
+  (modify-services %base-services
+    (mingetty-service-type config =>
+                           (auto-login-to-tty config "tty3" "alice"))))
+
+(operating-system
+    (host-name "antelope")
+    ...
+    (services
+     (append
+      (list (service dhcp-client-service-type))
+      %my-base-services)))
+@end lisp
+
+Note that the above code will automatically login the user @code{alice}
+into @code{tty3}. You can auto-login your user to any TTY, though it's
+usually advisable to avoid @code{tty1}, as by default it is used to log
+warnings and errors.
+
+
 @node Customizing the Kernel
 @section Customizing the Kernel
 
-- 
2.32.0





This bug report was last modified 3 years and 319 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.