From owner-freebsd-questions@FreeBSD.ORG Sat Apr 7 08:09:56 2012 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03FB01065674 for ; Sat, 7 Apr 2012 08:09:56 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id B653C8FC15 for ; Sat, 7 Apr 2012 08:09:55 +0000 (UTC) Received: from r56.edvax.de (port-92-195-101-40.dynamic.qsc.de [92.195.101.40]) by mx01.qsc.de (Postfix) with ESMTP id 50F6E3D385; Sat, 7 Apr 2012 10:09:48 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id q3789l4K006935; Sat, 7 Apr 2012 10:09:47 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Sat, 7 Apr 2012 10:09:47 +0200 From: Polytropon To: tak.official@gmail.com Message-Id: <20120407100947.cd05d526.freebsd@edvax.de> In-Reply-To: References: Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: questions@freebsd.org Subject: Re: define a default username for logging in X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Apr 2012 08:09:56 -0000 On Sat, 7 Apr 2012 12:21:57 +0430, takCoder wrote: > Hi All :) > > i'm trying to find a way to enable a required feature : to set *default > username *in my Freebsd 8.2 server.. > > i mean, i wanna be able to login with just entering My Master Password(no > usernames needed.. also prefer it to be per tty), which is *not related to > my root account, *but is the password of a user which i have defined as my > default user.. > > is it possible for, e.g. pam_login module (i couldn't find any manuals on > such feature yet..), to have such a config or is there any other ways to > set such default username for login? It is, but I assume my answer will just be a half of the whole story. The problem will be: no password. But maybe you can find some inspiration and then extend the procedure to fit your needs. 1. Modify /etc/gettytab as follows: default:\ ... localautologin:\ :al=:tc=Pc: a|std.110|110-baud:\ ... where is the name of the user you want to login as (given by the al= parameter, and "inheriting" the tc= settings). Make sure the user does exist in the system. 2. Modify /etc/ttys as follows: ttyv0 "/usr/libexec/getty localautologin" cons25 on secure and maybe change cons25 to cons25l1 (or any other value that might be required). As I said initially, this does _not_ prompt for a password! Maybe /etc/passwd's shell field allows you to add the password protection. If you're logging in remotely, ssh @yourserver.qw.er.tzu will only prompt for a password. This idea offers an opportunity to something overcomplicated: Create a user for localautologin that is _not_ your default user name. Make this user login automatically, and into his ~/.login, place the command "ssh @localhost" so right after performing the localautologin, ssh will attempt to connect to localhost _as _ and _prompt for_ the password. Terrible, I know. :-) To milden the pain of this approach, you could allow telnet for localhost, i. e. "from 127.0.0.1 to 127.0.0.1 _ONLY_ and nothing more", and use telnet instead of ssh in the ~/.login command. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...