Re: define a default username for logging in
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 free...@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, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
define a default username for logging in
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? i've googled most of the keywords i thought might be related, but haven't find any related answers except for maybe working on nsswitch.conf or master.passwd or login.conf options (which are, as you see, really *different ways, *and also none seems to be behaved per tty..) and now, i'm not quite sure whether i'm taking the correct steps or not.. and i've got a bit confused.. would anyone please helps me find the way? thanks a lot for your helps :) Best Regards, takCoder ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: define a default username for logging in
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, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org