Linux PAM Program/µ¯³ö»ñµÃrootȨÏÞ¶Ô»°¿ò
ʲôҲ²»ÒªËµ£¬ÏÈÀ´Ò»¸ö³ÌÐò°É¡£
/*
×¢ÒâÒªºÍÄãµÄϵͳһÖÂredhatÊÇÕâÑù/etc/pam.d/check_user
auth required /lib/security/pam_unix_auth.so
account required /lib/security/pam_unix_acct.so
1.Èç¹ûÐèÒª³öÏÖÃÜÂ뵯³ö¿ò»¹ÐèÒªÔÚÌí¼Ó
/etc/security/console.apps/check_user
USER=root
PROGRAM=~/check_user #Õâ¸ö·¾¶¾ÍÊÇÏÂÃæ±àÒëºÃºóµÄ·¾¶£¬²»ÄܺÍ3ÖÐ×÷Á´½ÓµÄ·¾¶Ò»Ñù
SESSION=true
2.ÔÙ¶Ô/usr/bin/consolehelper×÷ln
sudo ln -s consolehelper check_user
3.ÕâÑùÔËÐÐ/usr/bin/check_user¾Íʵ¼ÊÔÚµ÷ÓÃconsolehelper£¬ÔÙÈ¥¶ÁÈ¡
/etc/security/console.apps/check_userÀïPROGRAMÉ趨µÄ·¾¶
4.±àÒëʱҪÕâÑù:
gcc check.c -ldl -lpam -lpam_misc -o ~/check_user
*/
#include <security/pam_appl.h>
#include <security/pam_misc.h>
#include <stdio.h>
static struct pam_conv conv = {
misc_conv, //¶¨ÒåÔÚpam_misc.hÖÐ, ·½±ãÄã±à³Ì
NULL
};
int main(int argc, char *argv[])
{
pam_handle_t *pamh=NULL;
int retval;
const char *user="root"; //Óû§ÃûÉèÖÃΪϵͳÉϵÄÒ»¸öºÏ·¨Óû§
if(argc == 2) {
user = argv[1];
}
if(argc > 2) {
fprintf(stderr, "Usage: check_user [username]\n");
exit(1);
}
retval = pam_start("check_user", user, &conv, &pamh);
/* ¿ªÊ¼ */
if (retval == PAM_SUCCESS)
retval = pam_authenticate(pamh, 0);
/* ÈÏÖ¤ÊDz»ÊǸÃÓû§? ÌáʾÄãÊäÈëÒ»¸öÃÜÂë */
if (retval == PAM_SUCCESS)
retval = pam_acct_mgmt(pamh, 0);
/* Õ˺ÅÊÇ·ñÓÐЧ? */
if (retval == PAM_SUCCESS) {
fprintf(stdout, "Authenticated\n");
} else {
fprintf(stdout, "Not Authenticated\n");
}
if (pam_end(pamh,retval) != PAM_SUCCESS) {
/* ½áÊø */
pamh = NULL;
fprintf(stderr, "check_user: failed to release authenticator\n");
exit(1);
}
return ( retval == PAM_SUCCESS ? 0:1 ); /* indicate success */
}
#gcc check.c -ldl -lpam -lpam
Ïà¹ØÎĵµ£º
1. HCI²ãÐÒé¸ÅÊö£º
HCIÌṩһÌ×ͳһµÄ·½·¨À´·ÃÎÊBluetoothµ×²ã¡£ÈçͼËùʾ£º
´ÓͼÉÏ¿ÉÒÔ¿´³ö£¬Host Controller Interface(HCI) ¾ÍÊÇÓÃÀ´¹µÍ¨HostºÍModule¡£Hostͨ³£¾ÍÊÇPC£¬ ModuleÔòÊÇÒÔ¸÷ÖÖÎïÀíÁ¬½ÓÐÎʽ£¨USB,serial,pc-cardµÈ£©Á¬½Óµ½PCÉϵÄbluetooth Dongle¡£
ÔÚHostÕâÒ»¶Ë£ºapplication,SDP,L2capµÈÐÒé ......
(Ê®)Îȶ¨ÄÜÁ¦Æª¡¡
¡¡¡¡ÔËÐÐLinuxµÄ»úÆ÷Æô¶¯Ò»´Î¿ÉÒÔÔËÐÐÊýÔ¡£LinuxÌṩÁËÍêÈ«µÄÄÚ´æ±£»¤£¬Ã¿¸ö½ø³Ì¶¼ÔËÐÐÔÚ×Ô¼ºµÄÐéÄâµØÖ·¿Õ¼äÖУ¬²¢ÇÒ²»»áËð»µÆäËû½ø³Ì»òÄÚºËʹÓõĵØÖ·¿Õ¼ä¡£ÈÎÎñÓëÄں˼äÒ²ÊÇÏ໥¸ôÀ룬¼´ÐÐΪ²»Á¼»ò±àд²»Á¼µÄ³ÌÐòÖ»Äܻٻµ×Ô¼º¡£Òò´Ë±»ÆÆ»µµÄ½ø³Ì¼¸ºõ²»¿ÉÄÜʹϵͳ±ÀÀ£¡£LinuxÔÚºÍWindows98ºÍNTÔ ......
µÚÒ»²½ ÏÂÔØ°²×°Îļþ... 2
1.1 È·ÈÏϵͳ°æ±¾... 2
1.2 ÏÂÔز¹¶¡... 2
¶þ, Éý¼¶×¼±¸... 4
Èý, Éý¼¶ÅäÖÃ... 5
3.1 identify the oracle9i installation. 5
3.2 ÔĶÁÉý¼¶×¢ÒâÊÂÏî... 6
3.3 ÉÏ´«Éý¼¶°ü²¢½âѹ... 6
3.4 È·ÈÏ»·¾³±äÁ¿ORACLE_SIDºÍORACLE_HOMEÉèÖÃ. 6
3.5 shut Down oracle Database. 7
3.6 Í£ÓÃËùÓнø³ ......
linuxÍøÇÅģʽvlantrunk͸´«
2007-12-27 08:30
Ê×ÏÈʹÓÃvconfig´´½¨vlanÐéÄâ½Ó¿Ú£¬²¢·Ö±ðÔÚÁ½¸ö½Ó¿ÚÉÏÔö¼Óvlan100\vlan200\vlan300
vconfig add eth0 100
vconfig add eth0 100
vconfig add eth0 300
vconfig add eth1 100
vconfig add eth1 200
vconfig add eth1 300
ÆôÓÃvlan¶Ë¿Ú
ifconfig eth0.10 ......