From owner-freebsd-questions@FreeBSD.ORG Wed Apr 18 06:27:19 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 87CB91065672 for ; Wed, 18 Apr 2012 06:27:19 +0000 (UTC) (envelope-from talayeh.asadi@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4925C8FC1C for ; Wed, 18 Apr 2012 06:27:19 +0000 (UTC) Received: by obqv19 with SMTP id v19so9654263obq.13 for ; Tue, 17 Apr 2012 23:27:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=lBHfo5jRjsJJrCEnhV09y303T17Ar0/LgKEZO9iwzSM=; b=i5fCBzgz2JyzWbWh8BX/QwW/lQFTPQvyC+ovx9pI8OcY3JEmq/blR4ZcE5WG5PV8ot MIHLW/i1uZCwWFiMaAI7Q+lisjIz67Rxj5rYEtdGoGbzK1SYUUAX/VLel6KVuBdRq3qy U4wBH0eL0ecK0Jak7/qLE8qD2ecPKQjJ0rrKZ7A7XfSGh3MKGAZDn6Irte92KnNyWrWo TR9d/3BYRkRNEQpaj99MHZ97NMGnNqsuy2xJA4qshK52dlWNQGNdhXFbCHbBONSSCUgV KIHcFhravZirRsOEjIfe023zU6XNDJ+UFMUE/M0J03fp1KCus2fwAkm5f705TS0HJWlb Fqkw== Received: by 10.60.20.230 with SMTP id q6mr1226882oee.60.1334730438646; Tue, 17 Apr 2012 23:27:18 -0700 (PDT) MIME-Version: 1.0 Sender: talayeh.asadi@gmail.com Received: by 10.182.64.231 with HTTP; Tue, 17 Apr 2012 23:26:58 -0700 (PDT) In-Reply-To: <20120407100947.cd05d526.freebsd@edvax.de> References: <20120407100947.cd05d526.freebsd@edvax.de> From: takCoder Date: Wed, 18 Apr 2012 10:56:58 +0430 X-Google-Sender-Auth: 8Xi0zcr8bwNhhcDAq-4Te3qWtAs Message-ID: To: Polytropon Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 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: tak.official@gmail.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2012 06:27:19 -0000 Hi again, Really Thank You for your tricky advice.. it was a Nice one(and seems to be "the Only one"!).. :) sorry for late reply; it took me a while to become sure i got no other ways that bothering you again.. the suggested way seems to work, but i've got a problem: how can i apply these settings on pts devices?! i mean, how can i disable login on pts devices to continue the rest? do you have any idea?? i tried the same format in /etc/ttys, but it didn't work.. i could not find any tips via googling as well.. so.. :) you know, it's not that important to be able to use all 999 enabled pts devices on my server! i can abound them if there is a file such as /etc/ttys for per pty device configurations.. looking forward to receive your ideas. Thanks in Advance :) takCoder On Sat, Apr 7, 2012 at 12:39 PM, Polytropon wrote: > 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, ... >