📄 loginlib.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/loginLib.html - generated by refgen from loginLib.c --> <title> loginLib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.htm"><i>VxWorks API Reference : OS Libraries</i></a></p></blockquote><h1>loginLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>loginLib</strong> - user login/password subroutine library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./loginLib.html#loginInit">loginInit</a>( )</b> - initialize the login table<br><b><a href="./loginLib.html#loginUserAdd">loginUserAdd</a>( )</b> - add a user to the login table<br><b><a href="./loginLib.html#loginUserDelete">loginUserDelete</a>( )</b> - delete a user entry from the login table<br><b><a href="./loginLib.html#loginUserVerify">loginUserVerify</a>( )</b> - verify a user name and password in the login table<br><b><a href="./loginLib.html#loginUserShow">loginUserShow</a>( )</b> - display the user login table<br><b><a href="./loginLib.html#loginPrompt">loginPrompt</a>( )</b> - display a login prompt and validate a user entry<br><b><a href="./loginLib.html#loginStringSet">loginStringSet</a>( )</b> - change the login string<br><b><a href="./loginLib.html#loginEncryptInstall">loginEncryptInstall</a>( )</b> - install an encryption routine<br><b><a href="./loginLib.html#loginDefaultEncrypt">loginDefaultEncrypt</a>( )</b> - default password encryption routine<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library provides a login/password facility for network access to theVxWorks shell. When installed, it requires a user name and password matchto gain access to the VxWorks shell from rlogin or telnet. Therefore VxWorkscan be used in secure environments where access must be restricted.<p>Routines are provided to prompt for the user name and password, and verify the response by looking up the name/password pair in a login usertable. This table contains a list of user names and encrypted passwordsthat will be allowed to log in to the VxWorks shell remotely. Routines areprovided to add, delete, and access the login user table. The list ofuser names can be displayed with <b><a href="./loginLib.html#loginUserShow">loginUserShow</a>( )</b>.<p></blockquote><h4>INSTALLATION</h4><blockquote><p>The login security feature is initialized by the root task, <b><a href="./usrConfig.html#usrRoot">usrRoot</a>( )</b>, in<b>usrConfig.c</b>, if the configuration macro <b>INCLUDE_SECURITY</b> is defined. Defining this macro also adds a single default user to the login table.The default user and password are defined as <b>LOGIN_USER_NAME</b>and <b>LOGIN_PASSWORD</b>. These can be set to any desired name and password.More users can be added by making additional calls to <b><a href="./loginLib.html#loginUserAdd">loginUserAdd</a>( )</b>. If<b>INCLUDE_SECURITY</b> is not defined, access to VxWorks will not be restrictedand secure.<p>The name/password pairs are added to the table by calling <b><a href="./loginLib.html#loginUserAdd">loginUserAdd</a>( )</b>,which takes the name and an encrypted password as arguments. The VxWorkshost tool vxencrypt is used to generate the encrypted form of a password.For example, to add a user name of "fred" and password of "flintstone",first run vxencrypt on the host to find the encryption of "flintstone" asfollows:<pre> % vxencrypt please enter password: flintstone encrypted password is ScebRezb9c</pre>Then invoke the routine <b><a href="./loginLib.html#loginUserAdd">loginUserAdd</a>( )</b> in VxWorks:<pre> loginUserAdd ("fred", "ScebRezb9c");</pre>This can be done from the shell, a start-up script, or application code.<p></blockquote><h4>LOGGING IN</h4><blockquote><p>When the login security facility is installed, every attempt to rloginor telnet to the VxWorks shell will first prompt for a user name and password.<pre> % rlogin target VxWorks login: fred Password: flintstone -></pre>The delay in prompting between unsuccessful logins is increased linearly withthe number of attempts, in order to slow down password-guessing programs.<p></blockquote><h4>ENCRYPTION ALGORITHM</h4><blockquote><p>This library provides a simple default encryption routine,<b><a href="./loginLib.html#loginDefaultEncrypt">loginDefaultEncrypt</a>( )</b>. This algorithm requires thatpasswords be at least 8 characters and no more than 40 characters.<p>The routine <b><a href="./loginLib.html#loginEncryptInstall">loginEncryptInstall</a>( )</b> allows a user-specified encryptionfunction to be used instead of the default.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>loginLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./shellLib.html#top">shellLib</a></b>, vxencrypt,<i>VxWorks Programmer's Guide: Shell </i><hr><a name="loginInit"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>loginInit( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>loginInit( )</strong> - initialize the login table</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void loginInit (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine must be called to initialize the login data structure used byroutines throughout this module. If the configuration macro <b>INCLUDE_SECURITY</b>is defined, it is called by <b><a href="./usrConfig.html#usrRoot">usrRoot</a>( )</b> in <b>usrConfig.c</b>, before any otherroutines in this module.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./loginLib.html#top">loginLib</a></b><hr><a name="loginUserAdd"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>loginUserAdd( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>loginUserAdd( )</strong> - add a user to the login table</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS loginUserAdd ( char name[MAX_LOGIN_NAME_LEN+1], /* user name */ char passwd[80] /* user password */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine adds a user name and password entry to the login table.Note that what is saved in the login table is the user name and theaddress of <i>passwd</i>, not the actual password.<p>The length of user names should not exceed <b>MAX_LOGIN_NAME_LEN</b>, whilethe length of passwords depends on the encryption routine used. For thedefault encryption routine, passwords should be at least 8 characters longand no more than 40 characters.<p>The procedure for adding a new user to login table is as follows:<table></tr><tr valign=top><td>(1)<td>Generate the encrypted password by invoking vxencryptin <b>host/<i>hostOs</i>/bin</b>.</tr><tr valign=top><td>(2)<td>Add a user by invoking <b><a href="./loginLib.html#loginUserAdd">loginUserAdd</a>( )</b> in the VxWorks shellwith the user name and the encrypted password.</table>The password of a user can be changed by first deleting the user entry,then adding the user entry again with the new encrypted password.<p></blockquote><h4>EXAMPLE</h4><blockquote><p><pre> -> loginUserAdd "peter", "RRdRd9Qbyz" value = 0 = 0x0 -> loginUserAdd "robin", "bSzyydqbSb" value = 0 = 0x0 -> loginUserShow User Name ========= peter robin value = 0 = 0x0 -></pre></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the user name has already been entered.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./loginLib.html#top">loginLib</a></b>, <b><a href="../../tornado/hutils/vxencrypt.html#top" >vxencrypt</a></b><hr><a name="loginUserDelete"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>loginUserDelete( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>loginUserDelete( )</strong> - delete a user entry from the login table</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS loginUserDelete ( char * name, /* user name */ char * passwd /* user password */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine deletes an entry in the login table.Both the user name and password must be specified to remove an entryfrom the login table.<p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -