define a default username for logging in
Polytropon
freebsd at edvax.de
Sat Apr 7 08:09:56 UTC 2012
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, ...
More information about the freebsd-questions
mailing list