guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Joshua Branson
Subject: [bug#49430] [PATCH] doc: Add auto login to tty guide to the cookbook.
Date: Tue, 6 Jul 2021 04:08:56 -0400

From: Joshua Branson <jbranso@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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]