From patchwork Tue Jul 6 08:08:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joshua Branson X-Patchwork-Id: 31191 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 90FE527BC81; Tue, 6 Jul 2021 09:10:15 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 51BFE27BC78 for ; Tue, 6 Jul 2021 09:10:15 +0100 (BST) Received: from localhost ([::1]:47556 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0g9m-0007De-AF for patchwork@mira.cbaines.net; Tue, 06 Jul 2021 04:10:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48642) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0g9b-000779-LD for guix-patches@gnu.org; Tue, 06 Jul 2021 04:10:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:35664) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0g9b-0005sb-Co for guix-patches@gnu.org; Tue, 06 Jul 2021 04:10:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m0g9b-0006X5-8F for guix-patches@gnu.org; Tue, 06 Jul 2021 04:10:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49430] [PATCH] doc: Add auto login to tty guide to the cookbook. References: <20210706062004.24820-1-jbranso@dismail.de> In-Reply-To: <20210706062004.24820-1-jbranso@dismail.de> Resent-From: Joshua Branson Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 06 Jul 2021 08:10:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49430 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49430@debbugs.gnu.org Cc: Joshua Branson , leo.prikler@student.tugraz.at Received: via spool by 49430-submit@debbugs.gnu.org id=B49430.162555896125028 (code B ref 49430); Tue, 06 Jul 2021 08:10:03 +0000 Received: (at 49430) by debbugs.gnu.org; 6 Jul 2021 08:09:21 +0000 Received: from localhost ([127.0.0.1]:47205 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0g8u-0006Vc-K9 for submit@debbugs.gnu.org; Tue, 06 Jul 2021 04:09:20 -0400 Received: from mx1.dismail.de ([78.46.223.134]:43979) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0g8s-0006VN-6V for 49430@debbugs.gnu.org; Tue, 06 Jul 2021 04:09:19 -0400 Received: from mx1.dismail.de (localhost [127.0.0.1]) by mx1.dismail.de (OpenSMTPD) with ESMTP id 97729ec3; Tue, 6 Jul 2021 10:09:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=dismail.de; h=from:to:cc :subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=20190914; bh=O1Uq58QW0lWYYgA/m7Q2c /G7z4qQbrbnqhXriXGdn3w=; b=TnR+xDpXbPkQWSl3qQlJOgjmKoRLy8tqrLTAy 3aPL17UlOWNiZA5C57sHJ8cuPU82oVTgJJm5h16hj8QcwqEZ1gdlzajemqOJuuwP 7tPrbgBnM5950e9+Ul96fmpcTNZZ/C+AoKACTflQknQT4sw//KDoD9rBMAhgKzcS BoE0VRR/C98Q0eIfg9ncc+5Ow5ucb2JVaiQO14ZWcdcJp8qVvjZBgWXDCbfduVb9 AH4GUnA1bzGWFOhBBGt1hJlkZ0X5+wND7XRcFszTGD9GN4u94OeFfOaco7F80gu7 wMAitZ7ExLQI6XCPlin/n1S7zR6U17j8ZesMpOFXmDLuBJD/g== Received: from smtp2.dismail.de ( [10.240.26.12]) by mx1.dismail.de (OpenSMTPD) with ESMTP id 95d88311; Tue, 6 Jul 2021 10:09:10 +0200 (CEST) Received: from smtp2.dismail.de (localhost [127.0.0.1]) by smtp2.dismail.de (OpenSMTPD) with ESMTP id f7f05e47; Tue, 6 Jul 2021 10:09:10 +0200 (CEST) Received: by dismail.de (OpenSMTPD) with ESMTPSA id d153477b (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Tue, 6 Jul 2021 10:09:09 +0200 (CEST) Date: Tue, 6 Jul 2021 04:08:56 -0400 Message-Id: <20210706080856.22614-1-jbranso@dismail.de> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Joshua Branson X-ACL-Warn: , Joshua Branson via Guix-patches X-Patchwork-Original-From: Joshua Branson via Guix-patches via From: Joshua Branson X-getmail-retrieved-from-mailbox: Patches From: Joshua Branson * 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