Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Apr 2012 10:56:58 +0430
From:      takCoder <tak.official@gmail.com>
To:        Polytropon <freebsd@edvax.de>
Cc:        questions@freebsd.org
Subject:   Re: define a default username for logging in
Message-ID:  <CAPkyVLwEDq18KM947RECFkDcec8SbLdKiTh9JQuWLFETWSEacw@mail.gmail.com>
In-Reply-To: <20120407100947.cd05d526.freebsd@edvax.de>
References:  <CAPkyVLy2W_b2rbeaf844=Jb3BE8CaxO889M6-Pay_MCtQCXOAA@mail.gmail.com> <20120407100947.cd05d526.freebsd@edvax.de>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <freebsd@edvax.de> 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=<USERNAME>:tc=Pc:
>
>        a|std.110|110-baud:\
>                ...
>
> where <USERNAME> 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 <USERNAME>@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 <USERNAME>@localhost" so
> right after performing the localautologin, ssh will attempt
> to connect to localhost _as <USERNAME>_ 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, ...
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPkyVLwEDq18KM947RECFkDcec8SbLdKiTh9JQuWLFETWSEacw>