LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-27-2005, 06:25 AM   #1
markelo
Member
 
Registered: Mar 2004
Distribution: Red hat 9 -> 64bit fedora
Posts: 190

Rep: Reputation: 30
Where is linux login source?


I have to change how login to system is done. So I have to change login code.

But where is the source? Is it in kernel sources or separate program? Additionally I would like to change login for x-window also and telnet but those are not nece4ssary. Most important things is when loggin in system using run level 3 ( no windowing system started yet ).

I am using kernel 2.6.7 and Xfree 4.3.0.

Changes that I need to make are that instead of checkking real username and password I would check for a fake username and password. After fake login real username and password could be used after certain actions have been done.

So basically my login checks username and password from some fake table and after that there is possibility to make real login which then uses real usernames and passwords.

Edit: Few typos.

Last edited by markelo; 02-27-2005 at 06:30 AM.
 
Old 02-27-2005, 02:39 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
"I have to change how login to system is done. So I have to change login code.

But where is the source? Is it in kernel sources or separate program?"

I think that it is part of bash.

--------------------------
Steve Stites
 
Old 02-27-2005, 06:07 PM   #3
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Nope ... bash is just a shell. Login is its own program, /bin/login. On Linux systems /bin/login tends to be part of the util-linux package. You can find the source for various util-linux version at kernel.org. In your case though, it might be easier just to write a new PAM (pluggable authentication module) to do what you want to do, and then modify the config files in /etc/pam.d (or the /etc/pam.conf file on some systems) to do authentication using your module. Seems cleaner than hacking /bin/login to me, at least.

edited to add: I did a little more googling, and some distros put /bin/login in part of the shadow utils package.

Last edited by btmiller; 02-27-2005 at 06:12 PM.
 
Old 02-27-2005, 06:07 PM   #4
lmmix
Member
 
Registered: Feb 2005
Distribution: debian sid, blfs 6.0
Posts: 41

Rep: Reputation: 15
i think 'login' belong to 'shadow'
http://packages.debian.org/stable/base/login

http://packages.debian.org/cgi-bin/s...le&release=all

and guess that you seek this
http://packages.debian.org/stable/utils/falselogin

--
http://lfs.osuosl.org/lfs/view/development/
 
Old 02-28-2005, 04:12 PM   #5
markelo
Member
 
Registered: Mar 2004
Distribution: Red hat 9 -> 64bit fedora
Posts: 190

Original Poster
Rep: Reputation: 30
Thank you for your answers. Hopefully that falselogin doesn't do everything that I intended because then I would have to invent something else ( reinventing a wheel is not allowed )

If someone has more I would still be interested what sourcefiles handle x-window login. Does that falselogin handle also x-window logins?
 
Old 02-28-2005, 06:27 PM   #6
lmmix
Member
 
Registered: Feb 2005
Distribution: debian sid, blfs 6.0
Posts: 41

Rep: Reputation: 15
you can elaborate on irc channel.

turn on gaim or xchat,
irc.freenode.org
#debian

http://meme.b9.com

http://www.fedoraforum.org/
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ssh remote login - how to source .bashrc automatically newsgroupie2003 Linux - General 2 08-16-2005 04:49 AM
linux login source code feetyouwell Linux - Software 2 04-24-2005 04:09 PM
login program source code czarherr Linux - Software 2 07-16-2004 03:01 PM
where is linux source build directory/kernel source tree? webazoid Linux - Software 2 07-01-2004 08:37 PM
linux login: incorrect login poweroff Linux - General 4 03-02-2004 03:03 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration