60 lines
1.8 KiB
HTML
60 lines
1.8 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
|
|
<TITLE>PATH HOWTO: Login</TITLE>
|
|
<LINK HREF="Path-6.html" REL=next>
|
|
<LINK HREF="Path-4.html" REL=previous>
|
|
<LINK HREF="Path.html#toc5" REL=contents>
|
|
</HEAD>
|
|
<BODY>
|
|
<A HREF="Path-6.html">Next</A>
|
|
<A HREF="Path-4.html">Previous</A>
|
|
<A HREF="Path.html#toc5">Contents</A>
|
|
<HR>
|
|
<H2><A NAME="s5">5. Login</A></H2>
|
|
|
|
<P>
|
|
<P>In text console there is a getty program waiting for user login. It
|
|
writes 'login:' and other messages. It is working in init
|
|
environment. When getty gets user to log in to the system, it invokes
|
|
the 'login' program. This program sets the user environment and
|
|
invokes the shell.
|
|
<P>Login program sets path as defined in /usr/include/paths.h. This
|
|
'login path' is different for root users and other users.
|
|
<P>for common users (_PATH_DEFPATH):
|
|
<BLOCKQUOTE><CODE>
|
|
<PRE>
|
|
/usr/local/bin:/usr/bin:/bin:.
|
|
</PRE>
|
|
</CODE></BLOCKQUOTE>
|
|
|
|
for root (_PATH_DEFPATH_ROOT):
|
|
<BLOCKQUOTE><CODE>
|
|
<PRE>
|
|
/sbin:/bin:/usr/sbin:/usr/bin
|
|
</PRE>
|
|
</CODE></BLOCKQUOTE>
|
|
<P>Common user's path does not contain any sbin directories. However, it
|
|
contains the current directory, '.', which is considered dangerous for
|
|
the root user. Not even /usr/local/bin is available for the root user.
|
|
<P>Login path is often overwritten by shell initialization. However, it
|
|
is possible to use other programs in /etc/passwd as user shells. For
|
|
example, I have used the following line to start PPP when I log in
|
|
using special user name. In this case, the pppd has exactly login
|
|
path.
|
|
<P>
|
|
<BLOCKQUOTE><CODE>
|
|
<PRE>
|
|
etu-ppp:viYabVlxPwzDl:1000:1000:Esa Turtiainen, PPP:/:/usr/sbin/pppd
|
|
</PRE>
|
|
</CODE></BLOCKQUOTE>
|
|
<P>
|
|
<P>
|
|
<HR>
|
|
<A HREF="Path-6.html">Next</A>
|
|
<A HREF="Path-4.html">Previous</A>
|
|
<A HREF="Path.html#toc5">Contents</A>
|
|
</BODY>
|
|
</HTML>
|