Customized shell login for third value besides username/password
Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Customized shell login for third value besides username/password
Hi,
I was wondering if it is possible to modify the shell login so that besides username and password, the system also prompts for a third value, say ticket number.
If possible, can this value be logged in some file similar to wtmp?
You could add the request for ticket number and the write to a log file into /etc/bashrc or /etc/bash_profile so that each user that logs in is required to input the ticket number then. You could even set that so it logs the user out if they DON'T input the requested information. (This assumes your users are all using bash - for other shells other login environment setting files would be modified e.g. /etc/profile for ksh or /etc/csh.login for csh.)
That would be the simplest way.
Otherwise you'd have to muck with PAM modules to achieve the effect you want.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.