ÔÚ Linux ϵͳ¹ÜÀíÖÐ, /etc ÏÂÃæµÄµµ°¸ÎÞÒɵİéÑÝÁ˼«¶ËÖØÒªµÄ½ÇÉ«, ÔÚÕâƪÎÄ
ÕÂÖÐ, ½«Îª¸÷λ½éÉÜ /etc ÏÂÿ¸öµµ°¸µÄÓÃ;, ¼°Ïà¹ØÖ¸ÁîµÄÔËÓÃ, Ï£ÍûÄÜΪ´ó¼ÒÔÚ³É
Ϊ System Administrator µÄ·ÉÏÓÐËùÖúÒæ.
ÌرðҪ˵Ã÷µÄÊÇ, ÔÚÕâƪÎÄÕÂÖÐ, ÓÐЩµµ°¸ÈÔȻûÓÐÌáµ½, ÕâÊÇÒòΪ, ÕâЩµµ°¸¶¼
²»ÊÇÒ»¶þÊ®ÐеÄÃèÊö¾Í¿ÉÒÔ½²ÍêµÄ! Èç /rc.d ϵĵµ°¸, inittab ÕâÁ½¸ö×îºÃ¾ÍÒªºÏ
ÆðÀ´½², ÒòΪÕâЩǣ³¶µ½ bootstrapping, ¾ø¶Ô²»ÊÇÈýÑÔÁ½Óï¾Í¿ÉÒÔ½²ÍêµÄ. ·²ÊÇÓÐÕâ
ÖÖÌØÐԵĵµ°¸, Óлú»áµÄ»°½«ÔÙΪ¸÷λ½éÉÜ......
/etc/DIR_COLORS : É趨ÔÚÓà ls ʱ , ¸÷ÖÖ²»Í¬µµ°¸ÐÍ̬ËùÓõÄÑÕÉ« , µ«ÊDz»ÄÜÓÃ
pipe ÔÙµ¼ÏòÊä³ö, ·ñÔò¾ÍûÓи÷ÖÖÑÕÉ«ÁË. Óɵµ°¸µÄÄÚÈÝ¿ÉÒÔºÜ
ÇáÒ×µÄÁ˽â, Èç default µÄ directory ÊÇÀ¶É«, ¾ßÓпÉÖ´ÐеµÈ¨
ÏÞµÄÊÇÂÌÉ«, ¶øѹËõµµÊǺìÉ«...... ÕâЩ¶¼¿ÉÒÀ¸öÈËϲºÃÀ´¼ÓÒÔ
¸ü¸Ä. Õâ¸öµµ°¸ÄÚÈÝдµÃºÜÇå³þ, Ïë±Ø¸÷λһÑÛÒ²¾Í¿ÉÒÔ¿´µÃ³öÀ´
, ÔÚÑÕÉ«µÄ×é³É·½Ãæ, ÎÒÃdz£Óà RGB ÈýÔÉ«µÄ³É·ÝÖµÀ´×éºÏ³ö¸÷
ÖÖ²»Í¬µÄÑÕÉ«. ÓÉ R,G,B Õâ¸ö bit ÊÇ 0 »òÊÇ 1 Èý¸öÖµ×éºÏ³öÑÕ
É«Õâ¸öµÀÀíËädzÏÔ, µ«¼ÙÈçÎÒÃǸüÁ˽â R,G, B µÄ¼ÓȨֵ·Ö±ðÊÇ
1,2,4 µÄ»°, ÄǾÍÔÙÒ²²»Ó÷Êé²éÑÕÉ«ÁË...... Ñ¡Ôñ×Ô¼ºµÄµ÷É«
ÅÌÀ´È¡´úÔ¤ÉèµÄµ÷É«ÅÌ, ÊǾ³£»á×öµÄÊÂ.
/etc/HOSTNAME : ¼Ç¼ÍêÕûµÄ hostname Óë domain name , Õâ¸öµµ°¸ÔÚÐëÒª hostname
µÄ³¡ºÏ»áÓõõ½ , Èç /etc/rc.d/rc.M µÈ ......
/etc/NETWORKING : YES , ûʲôÓà , ¸Ä³É NO »áÔõÑùÄØ ? »á¶ÔÍø·µÄʹÓûáÔì³ÉÓ°
ÏìÂð ? ´ð°¸ÊÇ·ñ¶¨µÄ .
/etc/X11 : link µ½ /var/X11/lib/X11
/etc/at.deny : ÔÚÕâ¸öµµ°¸ÖпɼÇÔØÄÇЩÈ˲»ÄÜʹÓÃatÕâ¸öÃüÁîÀ´×öһЩ later job
, ¼ÙÈç at.deny ÊÇ¿ÕµÄ, ¶øÇÒ at.allow Ò²²»´æÔڵĻ°. ÄǾÍÊÇÿ¸ö
È˶¼¿ÉÒÔÓà at Õâ¸öÃüÁî.
/etc/at.allow : Ïà¶ÔÓÚ at.deny , Õâ¸öµµ°¸¼ÇÔØÄÇЩÈË¿ÉÒÔʹÓà at Õâ¸öÖ¸Áî¹ØÓÚ
at Õâ¸öÖ¸Áî, ÎÒÏëËüµÄÖØÒªÐÔÊÇÎÞÓ¹ÖÃÒɵÄ, ¸÷λӦ¸ÃÒª»áÕâ¸öÖ¸
ÁîµÄÓ÷¨, »áÁËÕâ¸öÖ¸Áî, ¿ÉÒÔÔÚ¹¤×÷µÄÖ´ÐÐÉÏ»á¸üÓе¯ÐÔ¶ø¹ØÓÚ
at.deny Óë at.allow, at »áÏÈÈ¥ÕÒ at.allow, ¼ÙÈç´æÔÚ¶øÇÒÓмÇ
¼һЩÈ˵Ļ°, ÄǾÍÖ»ÓÐÕâЩÈËÄÜʹÓà at Õâ¸öÖ¸Áî, µ«¼ÙÈç
at.allow ²¢²»´æÔڵĻ°, ÄÇ at ¾Í»áÈ¥ÕÒ at.deny, ûÓÐÔÚ
at.deny ÖеÄÈ˶¼¿ÉÒÔʹÓà at Õâ¸öÖ¸ÁîÁË! ÌرðҪ˵Ã÷µÄÊÇ, at
µÄÖ´ÐÐʱ¼äÒ²Ðí»á²»ÈçÄãËùÔ¤ÆÚµÄ, ±ÈÈç˵Ã÷Ã÷Ò»¸öµµÄã½ÐËüÔÚ
7:02 Ö´ÐÐ, µ«ËüÈ´»áµÈµ½ 7:05 ²ÅÖ´ÐÐ, ÕâÊÇÒòΪ crond ÊÇÿÎå·Ö
ÖÓ²ÅÈ¥¿´¿´ at µÄ queue ÖÐÊÇ·ñÓÐÒªÖ´ÐÐµÄ job. µ±È», ÄãÒ²¿ÉÒÔ
¸Ä³Éÿ·ÖÖÓ¶¼È¥ check, µ«ÕâÑùËƺõûÓкܴóµÄÒâÒå, ³ý·ÇÄã¶Ôʱ¼ä
µÄ׼ȷ¶ÈÒªÇóµÄºÜÑϸñ, ·ñÔòÓ¦¸ÃûÓбØҪȥ¶¯²ÅÊÇ. ¸÷λ¿ÉÈ¥¿´¿´
/var/spool/cron/crontabs/root ÖоÍÓÐÏêϸ¼ÇÔØ, ÿÎå·ÖÖÓ run
Ò»´Î atrun, ËùÒÔ at ÃüÁîµÄÖ´Ðпɿ´³ÉÒÔÿÎå·ÖÖÓΪһµ¥Î».
/var/spool/atjobs: µ±ÄãʹÓà at À´°²ÅÅÒ»¼þ¹¤×÷ʱ, ϵͳ»á°Ñ
ÄãÄ¿Ç°µÄ»·¾³±äÊý¼°ËùÒªÓà at Ö´ÐеŤ×÷
³Ò»·Ýµ½Õâ¸öĿ¼Ïµĵµ°¸ÖÐ .
/var/spool/atspool : ʹÓà at ÃüÁîÖ®ºóËùµÃµ½µÄһЩѶϢ , »á±»
¼Ç¼ÔÚÕâÀï . ¿ÉÄÜÊÇ at ËùÒªÖ´ÐеÄÃüÁî´«
»ØµÄ´íÎóѶϢ , »ò´«»ØÖ´Ðгɹ¦µÄѶϢ .
/etc/csh.cshrc :
/etc/csh.login :ÕâÁ½¸öµµ°¸Ó¦¸ÃºÜÊìϤÂÞ! Ëü¾ÍÊǸ÷λ³£¼ûµ½µÄ.cshrc ¼°.login,
²»¹ý´ó¼Òͨ³£Ö»×¢Òâµ½×Ô¼ºµÄ home directory ÓÐÕâÁ½¸öµµ, µ«
/etc ÏÂÒ²ÓÐÕâÁ½¸öµµ, ²»¹ý /etc ϵÄÕâÁ½¸öµµ¾ø´ó²¿·ÝµÄÇé¿öÏÂ
¶¼ÊÇÓÉ system administrator ÔÚ maintain, Ò»°ã user ²»Ó¦¸ÃÓÐ
ȨÁ¦È¥¸Ä. ˳±ãÒ»ÌáµÄÊÇ, ϵͳ»áÏÈÈ¥ÕÒ /etc ÏÂÕâÁ½¸öµµ, ½ÓÖø²Å
¼ÓÉÏ×Ô¼º home directory ÖÐÄÇÁ½¸öµµµÄÉ趨. µ±È», ÓÐÁË.login
Ò²ÓÐ.logout,.logout ÖпÉÒÔдһЩ message, »òÖ´ÐÐһЩÃüÁî, µ±
ÄãÏ´ï logout Ö®ºó,.logout ¾Í»á±»Ö´ÐÐ.
/etc/disktab : ( disk parameter table ) ¼ÙÈçÄãÔÚ¸Õ¿ª»úÓÐ pass ´Åµú»úµÄһЩ²ÎÊý
¸ø kernel µÄ»° ( ͨ³£ÊÇÄãµÄÓ²µú±È½ÏÆæ¹Ö , ÐèÒª pass cylinders ,
heads , sectors ¸ø kernel ²Å×¥µÄµ½ , »òÕßÊÇ SCSI µÄÓ²µúÓÐʱ
ÓÐʱҲҪÓõ½Ò»Ð©²ÎÊý ) ÄÇÕâЩ²ÎÊý¾Í»á±»¼Ç¼ÔÚÕâÀï .
/etc/exports : Õâ¸öµµ°¸¼Ç¼ÖøÄãÒª¸ø±ðÈË mount µÄµµ°¸ÏµÍ³ , Õâ¾ÍÊǵäÐÍ NFS
ϵͳËù´æÔڵĵµ°¸ , TCP/IP for OS/2 ÈôҪʹÓà network file system
¶øÒª°Ñ×Ô¼ºµÄ filesystem ÈñðÈË mount µÄ»° , Õâ¸öµµ°¸Ò²ÊDz»¿É»òȱ
µÄ. ±ÈÈç˵ , ÎÒËùÔÚµÄ domain name Ϊ dorm10.nctu.edu.tw , ÎÒÒª°Ñ
ÎÒ /usr Ï嵀 filesystem ¿ª·Å¸øÊ®ÉáµÄÈË mount , ÄÇÎÒÔÚ exports ÖÐ
ÒªÕâÑùд :
/usr *.dorm10.nctu.edu.tw(ro)
½ÓÖø , ÔÚ /etc/rc.d/rc.inet2 ÖÐ , ÕÒµ½ÏÂÃæµÄ¶ÎÂä , ÕâЩ¶ÎÂä±¾À´
ÿһÁеÄÇ°Ã涼ÓÐ # , ÏÖÔÚ , ÒÀÕÕÏÂÃæµÄÄÚÈÝ , °ÑÕâЩ # Äõô .
......
......
......
# Start the SUN RPC Portmapper.
if [ -f ${NET}/rpc.portmap ]
then
echo -n " portmap"
${NET}/rpc.portmap
fi
......
......
......
# # Start the various SUN RPC servers.
if [ -f ${NET}/rpc.portmap ]
then
# if [ -f ${NET}/rpc.ugidd ]
# then
# echo -n " ugidd"
# ${NET}/rpc.ugidd -d
# fi
if [ -f ${NET}/rpc.mountd ]
then
echo -n " mountd"
${NET}/rpc.mountd
fi
if [ -f ${NET}/rpc.nfsd ]
then
echo -n " nfsd"
${NET}/rpc.nfsd
fi
# # Fire up the PC-NFS daemon(s).
if [ -f ${NET}/rpc.pcnfsd ]
then
echo -n " pcnfsd"
${NET}/rpc.pcnfsd ${LPSPOOL}
fi
# if [ -f ${NET}/rpc.bwnfsd ]
# then
# echo -n " bwnfsd"
# ${NET}/rpc.bwnfsd ${LPSPOOL}
# fi
fi
echo
# Done!
ÔÚ client ¶Ë¿ÉÓÃÈç :
mount -vt nfs rebel.dorm10.nctu. ¶ËµÄ /tmp
/etc/fastboot : Õâ¸öµµ°¸ÊÇʹÓà shutdown -f Ëù²úÉúµÄ , -f means "fastboot"
ÔÚÖØРreboot Ö®ºó , ϵͳ»áÈ¥¼ì²éÕâ¸öµµÊÇ·ñ´æÔÚ , ÒÔ¾ö¶¨
ÊÇ·ñÒª run fsck .
/etc/fdprm : floopy disk parameter table . Ò»°ãÇé¿öÏÂÊDz»ÐëÒª¸ü¶¯µÄ , ³ý·Ç
ÄãÓкÜÆæ¹Ö¸ñʽµÄÈíµú , »òÕßÄãÏë×ö³ö²»·ûºÏÒ»°ã¸ñʽµÄ´ÅµúƬ .
/etc/nologin : ÄãÒ²Ðí»á¸Ðµ½Ææ¹Ö , ÎÒµÄ /etc Õâ¸ö directory ϲ¢Ã»ÓÐÕâ¸öµµ°¡?
û´í , Ëüƽ³£ÊDz»´æÔÚµÄ , ͨ³£»á¿´µ½Õâ¸öµµµÄ»° , ÄDZíʾϵͳ´ó
¸ÅÒª shutdown ÁË , ÒòΪϵͳҪ shutdown ÁË , ×ÔÈ»²»Ï£ÍûÓÐÈËÓÖ
login ½øÀ´ , ËùÒÔÔÚÎÒÃÇÖ´ÐÐ shutdown ʱ , nologin Õâ¸öµµ»á×Ô¶¯
µÄ±» create , ÀïÃæ·ÅÖø shutdown message . ʵ¼ÊÉÏ , µ±ÎÒÃÇÔÚ
login ʱ , ϵͳ»áÈ¥¼ì²éÓÐûÓÐÕâ¸öµµ , ¼ÙÈçÓеĻ° , ÄǾͻáÓ¡³ö
Õâ¸öµµ°¸ÖÐµÄ message , È»ºó²»ÈÃÄã login .
nologin Ò²ÓпÉÄÜÊÇΪÁËijÖÖÀíÓɱ»ÖÆÔìµÄ , ±ÈÈç˵ϵͳÔÚ maintain
ÔÝʱ²»Ï£ÍûÓÐÈË login . ÎÞÂÛÈçºÎ nologin Èô´æÔÚ , ¾Í²»ÄÜ login
/etc/fstab : ¼Ç¼¿ª»úÒª mount ÉÏÀ´µÄ filesystem, Õâ¸öµµ°¸Ï൱ÖØÒª! ¸÷λ¿ÉÒÔ
ÔÚ /etc/rc.d/rc.S ÖÐÕÒµ½ /sbin/mount -avt nonfs ÕâÒ»ÁÐ, µ±Ö´ÐÐ
µ½ÕâÒ»ÁÐʱ, mount ¾ÍÒÀ¾Ý /etc/fstab ÖеļÇÔØ, ×Ô¶¯µÄ½«µµ°¸ÏµÍ³
mount ÉÏÀ´. ÏÂÃæ¾ÍÊÇÒ»¸öÆÄΪµäÐ͵ķ¶Àý. ¼ÙÈçÄãÒ»¿ª»ú¾ÍÏë×Ô¶¯
mount һЩ filesystems, ¶ø²»ÒªµÈµ½¿ª»úºóÔÙÒÔÊÖ¶¯ mount µÄ»°ÄÇ°Ñ
ÕâЩ filesystems ¼°Ïà¹Ø×ÊѶдÔÚÕâ¸öµµ, ÊDz»´íµÄÑ¡Ôñ. ÔÚµµ°¸¸ñʽ
·½Ãæ, ÿһÁÐÓÐÁù¸öÀ¸Î», ²»¹ýºóÃæÁ½¸öÀ¸Î»³£±»Ê¡ÂÔËùÒÔÎÒÃÇÖ»¿´µ½
ÓÐËĸöÀ¸Î». ÆäËüµÄÁ½À¸·Ö±ðΪ dump-freq ¼° pass-number.
dump-freq Ô¤ÉèֵΪ 0; ¶ø pass-number ÊÇ fsck Ëù»á²Î¿¼µ½µÄµØ·½,
Êý×Ö¿ÉΪ 0,1,2...... 1 ±íʾÕâ¸ö filesystem ½«Ê×Ïȱ» fsck check,
2 ±íÆä´Î, âÅÀàÍÆ......
# Òª¹ÒÉϵĵµ°¸ÏµÍ³ ¹ÒÔÚÄÇÀï µµ°¸ÏµÍ³¸ñʽ ¶Áд״¿ö
/dev/hdb2 swap swap defaults
/dev/hdb1 / ext2 defaults
/dev/sbpcd /mnt/cdrom iso9660 ro
/dev/hda1 /mnt/dosc msdos rw
/dev/hda5 /mnt/dosd msdos rw
/dev/hda6 /mnt/dose msdos rw
none /proc proc defaults
/etc/ftpusers : Õâ¸öµµ°¸¼Ç¼ÄÇЩÈ˲»¿ÉÒÔ ftp Ç©Èëϵͳ , Ô¤ÉèÖµÓÐ root , uucp
news . ÕâЩ¶¼ÊÇΪÁË security ·½ÃæµÄ¿¼Á¿ , Äã¿ÉÒÔÔÚÕâÀï¼ÓÈë
²»¿É ftp ½øÀ´µÄ user id .
/etc/gateways : ¹ËÃû˼Òå , Õâ¸öµµ°¸¼Ç¼һЩ gateways µÄ information
Õâ¸öµµ°¸µÄ¸ñʽÈçÏ :
name1 gateway name2 metric value
µ± routed Æô¶¯Ê±, Ëü»áÈ¥¶Á /etc/gateways Õâ¸öµµ. ÈôÒ»¸ö gateway
²¢²»×ö routing information ½»»»µÄ»°, ÄÇËü¾Í»á±»±êʾ³É passive,
¼ÙÈçÓÐ×ö routing information µÄ½»»» ( Õą̂»úÆ÷ÉÏÓÐ run routed )
, ÄǾͻá±êʾ³É active net »ò host Õâ¸ö¹Ø¼ü×ÖÊÇÖ¸³ö route Êǵ½Íø
·»òÊǵ½Ò»Ì¨Ìض¨µÄ»úÆ÷ÉÏ. name1 ¾ÍÊÇÄ¿µØÍø·»òÄ¿µØ»úÆ÷µÄÃû×Ö.
Õâ¸öÃû×Ö¿ÉÓà /etc/hosts »òÊÇ /etc/networks ÖÐµÄ symbolic host
name. name2 ¾ÍÊÇѶϢ½«±»ËÍÍùÖ® gateway µÄ name»ò IP address.
/etc/group : Èçͬ /etc/passwd ÁгöÁËϵͳÖÐËùÓеÄʹÓÃÕßÃû×Ö , /etc/group
¶¨ÒåϵͳÖÐËùÓÐµÄ group name ÓëÏà¹ØѶϢ .
¸ñʽΪ: group_name:passwd:GID:user_list
Èç : author::200:jhhsu,emotion,passion
ÉÏÃæµÄÀý×Ó±íʾ jhhsu,emotion,passion ¶¼ÊÇÊôÓÚ author Õâ¸ö group
ͨ³£ passwd ÄÇÀ¸ÊÇ¿Õ°×µÄ , ±íʾ²»ÓÃÃÜÂë . »ò·ÅÒ»¸ö * ºÅ
ÒÔÏÂÒ²ÊÇÒ»¸öµäÐ͵ÄÀý×Ó :
root::0:root,jhhsu
bin::1:root,bin,daemon
daemon::2:root,bin,daemon
sys::3:root,bin,adm
adm::4:root,adm,daemon
tty::5:
disk::6:root,adm
lp::7:lp
mem::8:
kmem::9:
wheel::10:root,jhhsu
shadow::11:root
mail::12:mail
news::13:news
uucp::14:uucp
man::15:man
users::100:games
bbs:*:99:bbs,bbsuser,bbsroot
µ±È»À² ! Õâ¸öµµ°¸Ö»ÄÜΪ superuser Ëù¶Áд , Ò»¸ö superuser ¿Éʹ
Óà groupadd , groupdel , groupmod À´¹ÜÀí /etc/group Õâ¸öµµ ,
ÒªÊÖ¶¯¹ÜÀíÒ²ÊÇ¿ÉÒÔ . ÏÂÃæÊÇÕâÈý¸öÖ¸ÁîµÄÓ÷¨ :
groupadd [ -g gid [ -o ] ] group_name
groupdel group_name
groupmod [ -g gid [ -o ] ] [ -n new_group_name ] group_name
/etc/hosts : Õâ¸öµµ°¸¼Ç¼Öø IP address ÖÁ hostname µÄ mapping . ÈçÎÒÃÇÏë°Ñ
ccsun21.csie.nctu.edu.tw È¡¸ö±ðÃû½Ð : oldstock
ÄÇÎÒÃǾͿÉÒÔÔÚÕâ¸öµµ°¸ÀïдÈçϵÄÐðÊö :
140.113.17.151 oldstock
Èç´ËÒ»À´ , ÒÔºóÎÒÃÇ telnet oldstock ¾ÍµÈÓÚ telnet
140.113.17.151
ÔÚÕâ¸öµµ°¸ÖÐ , ÖÁÉÙ»áÓÐÁ½ÁÐ , Ò»ÁÐΪ loopback , ÕâÊÇΪÁËÕì´íÄ¿µÄ
¶øÉèµÄ , ÁíÒ»ÁÐΪ local host , ¾ÍÊÇÄã×Ô¼ºµÄ»úÆ÷ .
/etc/hosts.equiv : ÔÚÀïÃæ¿ÉÒÔÉ趨һЩ remote machine , ¶ø´ÓÕâЩ remote
machine ÀûÓà rsh »ò rlogin Á¬»Ø local machine µÄ»°
±ã²»ÓÃÊäÈëÃÜÂë
ͬÑùµÄ¶«Î÷Ò²¿ÉÒÔÔÚ .rhosts ¼ûµ½ . ±ÈÈç˵ÔÚ ccsun22.csie
.nctu.edu.tw ÉÏÄãµÄ Home Directory ½¨Ò»¸ö .rhosts µµ ,
ÀïÃæµÄÄÚÈÝÈçÏÂ:
rebel.dorm10.nctu.edu.tw jhhsu
ÒÔºóÖ»ÒªÔÚ rebel.dorm10.nctu.edu.tw ÉÏÀûÓÃ rsh »ò rlogin ÖÁ
ccsun22.csie.nctu.edu.tw µÄ»°
, Ò²²»ÐëÒªÊäÈëÃÜÂë
rsh -l jhhsu ccsun22.csie.nctu.edu.tw <-- ²»ÐëÃÜÂë
²»¹ýÕⶫÎ÷×îºÃ²»ÒªÂÒÉè , ÒÔÐŵùýµÄ hosts ΪÖ÷ ,
²Å²»»áÔì³É security ÉϵÄÀ§ÈÅ .
/etc/hosts.deny : É趨ÄÇЩ remote hosts ²»¿ÉÒÔʹÓà inetd
/etc/hosts.allow : É趨ÄÇЩ remote hosts ¿ÉÒÔʹÓà inetd
ÖÁÓÚ inetd ÓÐÄÇЩ service , ¸÷λ¿ÉÒÔÈ¥¿´¿´ /etc/inetd.conf
´ÓÀïÃæ¾Í¿ÉÒÔºÜÇå³þµÄ¿ÉÒÔ¿´µÃ³öÀ´ .
¼ÙÈçÄã²ÉÈ¡±È½Ï close ×÷·¨µÄ»° , ¿ÉÒÔÔÚ hosts.deny ÖÐд
ALL:ALL
µ«ÊÇÈç´ËÒ»À´ , Ö»Òª²»ÊÇ´Ó localhost À´µÄ , ÄÇ´ó¸Å¶¼²»±Ø
ÍæÁË , ËùÒÔ , ÎÒÃÇÒ²ÒªÊÊʱµÄÔÚ hosts.allow ÖмÓÈë¿ÉÒÔ
access µÄ hosts , Èç :
ALL:140.113.17. <-- Ö»Òª´Ó 140.113.17.X ¶¼¿ÉÒÔ access
ALL:140.113.4.
ALL:140.113.6.
/etc/hosts.lpd : ¼Ç¼¿É access printer µÄ hosts . ¼ÙÈçһ̨ printer¿É±»Íø·ÉÏ
µÄÐí¶ą̀Ö÷»úËù¹²ÓÃ, ÄÇ printcap Õâ¸öµµ°¸±ØÐëµÃÃèÊöÍêÕûµÄÍø
·É趨×ÊѶ. ÔڱȽÏÑÏÃÜ¿ØÖƵÄÇé¿öÏÂ, ÓÐÁ½¸öÌõ¼þ±ØÐë·ûºÏÊ×ÏÈ,
local machine ±ØÐëÔÚ remote machine µÄ /etc/hosts.eqiuv ÖÐ,
»òÕß, ÔÚ remote machine µÄ /etc/hosts.lpd Öб»¼ÇÔصڶþ, ʹ
ÓÃÕß±ØÐëÓÐ remote machine µÄÕʺÅ.
/etc/inetd.pid : inetd process id
/etc/issue : Õâ¸öµµ°¸±»¼Ç¼Öø login prompt Ç°ËùÒª echo µÄ message , ÌرðҪע
ÒâµÄÊÇ /etc/rc.d/rc.S
ÏÂÃæµÄËÄÐÐÈôûÓÐ mark , Ôòÿ´Î¿ª»ú issue ¼° motd ¶¼»á±»¸Ä±ä
¼ÙÈçÄãÒªÓÐ×Ô¼ºµÄÉ趨 , ÏÂÃæÒ»¶¨¶¼Òª mark ÆðÀ´ÈçÏ :
#echo > /etc/issue
#echo Welcome to Linux /bin/uname -a | /bin/cut -d\ -f3. >> /etc/issue
#echo >> /etc/issue
#echo "/bin/uname -a | /bin/cut -d\ -f1,3. (Posix)." > /etc/motd
/etc/klogd.pid : klogd process id
/etc/ld.so.conf : ¼Ç¼һЩ library ËùÔÚµÄĿ¼
/etc/magic : ³õ¿´Õâ¸öµµ°¸Ê± , Ò²ÐíÖ»ÄÜÒþÒþÔ¼Ô¼µÄ¿´µ½ : Õâ¸öµµ°¸ËƺõÊÇÃèÊöһЩ
µµ°¸µÄ¸ñʽ. û´í, Õâ¸öµµ°¸¼ÇÔØÁËÐí¶àµµ°¸¸ñʽµÄʶ±ð×Ö´®»ò·½·¨ÄÇ
Õâ¸öµµÔÚÄÇÀï»áÓõĵ½ÄØ? ¸÷λÓÐʹÓùý file Õâ¸öÖ¸ÁîÂð? file Õâ¸ö
Ö¸ÁîµÄÃüÁî¸ñʽΪ:
file [ -c ] [ -z ] [ -L ] [ -f namefile ] [ -m magicfile ] file
file Õâ¸öÖ¸Áî·Ç³£ÓÐȤ, Ëü¿ÉÒÔ¸æËßÄãijһ¸öµµ°¸µÄ¸ñʽ, ÈçËüÊÇÒ»¸ö
text µµ, »òÊÇÒ»¸ö shell script »ò DOS ¿ÉÖ´ÐеµµÈ...... ¶ø file
Õâ¸öÖ¸Áî, ¾ÍÊÇÈ¥²Î¿¼ /etc/magic Õâ¸ö×ÊÁÏ¿â. ¼ÙÈçÄãÖªµÀijһµµ°¸
µÄʶ±ð×Ö, ¶øÔÀ´ magic Õâ¸ö×ÊÁÏ¿âûÓмǼ, ÄÇÄã¿ÉÒÔ°Ñʶ±ð·½·¨¼Ó
µ½×ÊÁÏ¿âÖÐ, »òǬ´à½¨Á¢×Ô¼ºµÄ×ÊÁÏ¿âËãÁË.
/etc/motd : Õâ¸öµµºÜ¼òµ¥ , ¾ÍÊÇ message of the day µÄÒâ˼ , ÀïÃæ¿ÉÒÔдһЩ
message , ¶øÕâЩ message »áÔÚ login shell ֮ǰ±»ÏÔʾ³öÀ´ .
ͨ³£¶¼ÊÇ system administrator Òª¸æÖª user µÄһЩѶϢ. ¶ø¹ØÓÚÿ´Î
/etc/mtab : Ä¿Ç° mount ÉÏÀ´µÄ filesystems , ¸÷λ¿ÉʹÓà mount Õâ¸öÖ¸ÁîÀ´¿´¿´
Õâ¸öµµµÄ±ä»¯ . ÈçÎÒÔÚ mount 3.5 inch ÈíµúA Ç° , ÎÒ¿´µ½µÄ mtab
ÈçÏ :
/dev/hdb1 / ext2 rw 0 0
/dev/hda1 /mnt/dosc msdos rw 0 0
/dev/hda5 /mnt/dosd msdos rw 0 0
/dev/hda6 /mnt/dose msdos rw 0 0
none /proc proc rw 0 0
È»¶ø , µ±ÎÒÒÔ mount -t msdos /dev/fd0H1440 /mnt/dosa Õâ¸öÖ¸Á
3.5 inch ÈíµúA ¹ÒÉÏÀ´ºó , mtab ±äΪÏñÏÂÃæµÄÇé¿ö :
/dev/hdb1 / ext2 rw 0 0
/dev/hda1 /mnt/dosc msdos rw 0 0
/dev/hda5 /mnt/dosd msdos rw 0 0
/dev/hda6 /mnt/dose msdos rw 0 0
none /proc proc rw 0 0
/dev/fd0H1440 /mnt/dosa msdos rw 0 0 <-- ¶àÁËÕâÁÐ !
ËùÒÔ , ¸÷λÁ˽âÀ² ! /etc/mtab ¾ÍÊǼǼĿǰ mount µÄ filesystem
/etc/mtools : ÕâÀïÃæ¼Ç¼µÄ , ÊǸø /usr/bin/mtools ²Î¿¼ÓÃµÄ parameter .
ÄÇ mtools ÊÇʲôÄØ? ¼ò¶øÑÔÖ® , ¾ÍÊÇһȺ²Ù×÷ MSDOS µµ°¸µÄÃüÁî
¼¯ºÏ , ¿ÉÓõÄÃüÁî¿É¶àÁË , ÈçÏ :
mattrib - change MSDOS file attribute flags
mcd - change MSDOS directory
mcopy - copy MSDOS files to/from Unix
mdel - delete an MSDOS file
mdir - display an MSDOS directory
mformat - add an MSDOS filesystem to a low-level formatted diskette
mlabel - make an MSDOS volume label
mmd - make an MSDOS subdirectory
mrd - remove an MSDOS subdirectory
mread - low level read (copy) an MSDOS file to Unix
mren - rename an existing MSDOS file
mtype - display contents of an MSDOS file
mwrite - low level write (copy) a Unix file to MSDOS
ÕâЩ¶¼±» link µ½ mtools
/etc/named.boot : ¼ÙÈçÄãÒª½¨Á¢ name server µÄ»° , ÄÇÕâ¸öµµ¾ÍÊÇÄãÒªÐ޸ĵĵط½
ÏêϸµÄÇé¿ö¿ÉÒÔÈ¥¿´ named µÄ manual ¾ÍÖªµÀÁË .
/etc/named.pid : named process id
/etc/networks : Õâ¸öµµÓë hosts ÓеãÏñ , ¶¼ÊÇÔÚ boot µÄʱºò»áÓõ½µÄ¶«Î÷ ,
ÔÚÕâÀï¿ÉÒÔ¶¨ÒåÒ»¸ö×ÓÍø·ÓëÆä IP address µÄ×ÊѶ .
/etc/nntpserver : Õâ¸öµµ°¸¼Ç¼Öø news server , µ±ÎÒÃÇʹÓà tin -r ( read news
remotely ) ʱ, Õâ¸öµµ°¸»á±»²Î¿¼µ½, »òÕßÈôÕâ¸öµµ°¸²»´æÔÚµÄ
»°, ÄÇ»·¾³±äÊý NNTPSERVER ËùÖ¸¶¨µÄ server ¾Í»á±»µ±³ÉҪȥȡ
µÃ news µÄ server. Æ©Èç˵, ÄãÒª½« 140.111.1.11 µ±³É news
server, ÄÇ /etc/nntpserver ÖоͿÉд:
140.111.1.11
/etc/nologin : ÄãÒ²Ðí»á¸Ðµ½Ææ¹Ö , ÎÒµÄ /etc Õâ¸ö directory ϲ¢Ã»ÓÐÕâ¸öµµ°¡?
û´í, Ëüƽ³£ÊDz»´æÔÚµÄ, ÒªÊÇÄã¿´µ½Õâ¸öµµµÄ»°, ÄDZíʾϵͳ´ó¸Å
Òª shutdown ÁË, ÒòΪϵͳҪ shutdown ÁË, ×ÔÈ»²»Ï£ÍûÓÐÈËÓÖ
login ½øÀ´, ËùÒÔÔÚÎÒÃÇÖ´ÐÐ shutdown ʱ, nologin Õâ¸öµµ»á×Ô¶¯
µÄ±» create, ÀïÃæ·ÅÖø shutdown message. ʵ¼ÊÉÏ, µ±ÎÒÃÇÔÚ
login ʱ, ϵͳ»áÈ¥¼ì²éÓÐûÓÐÕâ¸öµµ, ¼ÙÈçÓеĻ°, ÄǾͻáÓ¡³öÕâ
¸öµµ°¸ÖÐµÄ message, È»ºó²»ÈÃÄã login. nologin Ò²ÓпÉÄÜÊÇΪÁË
ijÖÖÀíÓɱ»ÖÆÔìµÄ, ±ÈÈç˵ϵͳÔÚ maintain ÔÝʱ²»Ï£ÍûÓÐÈË login.
ÎÞÂÛÈçºÎ nologin Èô´æÔÚ, ¾Í²»ÄÜ login
/etc/passwd : ºÇºÇ , Õâ¸öµµ°¸¿ÉÖØÒªÁË . Ò»¸ö system administrator ×î³õҪѧµÄ
³£³£¾ÍÊÇÕâ¸öµµ°¸µÄÄÚÈÝ! Õâ¸öµµ°¸¼Ç¼Öøϵͳ¿ÉÒÔÈÏµÃµÄ user, µ±
È»À², Ò²°üÀ¨Ò»Ð©·ÇÈ赀 login name, µ«ÕâÊÇÓÐÌØÊâÓÃ;µÄ. µµ°¸ÄÚ
ÈÝÿÁеĸñʽÈçÏÂ:
Login Name:Encrypted Password:UID:GID:GCOS:Home Directory:Login Shell
(1)login name: ÔÚ login name ·½Ãæ , ÿ¸ö login name ±ØÐëÊÇΨһµÄ ,
¶øÇÒ²»Äܳ¬¹ý 8 ¸ö×ÖÔª, Ò»°ã˵À´, login name ËäÈ»¿ÉÒÔ
´óСд»ìºÏ, µ«Æ½³£µÄÇé¿ö϶¼ÓÃСд. ˳±ãÒ»ÌáµÄÊÇ
/usr/lib/aliases Õâ¸öµµ°¸, ÐÞ¸ÄÕâ¸öµµ°¸µÄÄÚÈÝ¿ÉÒÔʹ
mail ʱÓó¬¹ý 8 ¸ö×ÖÔªµÄµµ°¸. Èçƽ³£ mail
jhhsu@dorm10 .nctu.edu.tw ¿É±ä³É mail
Jin-Hwa-Sheu@dorm10.nctu.edu. tw.
(2)Encrypted Password: ÕâÀ¸ÊDZàÂë¹ýµÄÃÜÂë , ÔÚÐÂÔöÒ»¸ö new user ʱ
Ó¦¸ÃÔÚÕâÀ¸ÌîÉÏ * , ¸ü¸Ä password ¿ÉÓà passwd
Õâ¸öÖ¸Áî . passwd ÕâÊÇÒ»¸ö setuid µÄÖ¸Áî ,
¹ØÓÚ setuid , setgid , stickybit , ¸÷λ¿ÉÈ¥
²Î¿¼ Unix Security ·½ÃæµÄÊé¼® .
(3)UID: user id , ÿ¸ö"ÈË"¶¼Òª²»Ò»Ñù , Ï°¹ßÉÏ , 100 ÒÔÇ°±»±£Áô×öΪ
ÌØÊâµÄ user id , ¶ø root ×ÜÊÇ 0.
(4)GID: group id , ÔڱȽÏÔçÆÚµÄϵͳ , Ò»¸ö user ͬʱֻÄÜÔÚÒ»¸ö group
²»¹ýÏÖÔÚ¾ÍûÓÐÕâÖÖÏÞÖÆÁË .
(5)GCOS: ÕâÀ¸»ù±¾ÉÏûÓÐÌØÊâ¸ñʽÏÞÖÆ , ÔÚÕâÀï¿ÉÒÔдÉÏÄãµÄ full name
¼ÒÖе绰, סַµÈ...... °®Ð´Ê²Ã´¾Íдʲô. ËäÈ»Äã¿ÉÒÔÂÒдһ
ͨ, µ«ÈôÄãÓõ½¶ººÅ, ϵͳ»á°ÑËüµ±³ÉÇø¼ä. ÈçÄãд: Jin-Hwa
Sheu, NCTU, 80317, (02)1234123 ÕâЩ¶¼»á±»µ±³É Full Name,
Office, Home Phone. finger Õâ¸öÖ¸Áî»áÈ¥¶ÁÕâµØ·½µÄ×ÊѶ. ÓÃ
chfn ¿É¸Ä±äÕâÀ¸.
(6)Home Directory: ÕâÀ¸Ã»Ê²Ã´ , ¾ÍÊǼǼ user µÄ home directory ¶øÒÑ
ÀûÓà cd »ò cd~ ¶¼¿É»Øµ½ home directory .
(7)Login Shell: É趨ʹÓÃÕßËùʹÓÃµÄ shell , Ô¤ÉèÖµÊÇ /bin/bash . µ±
È» , ÄãÒ²¿ÉÒÔ×Ô¼º¸Ä³É csh »ò tcsh , zsh Ò²ÊDz»´í ,
¼ÙÈçÓÐ free °æµÄ korn Shell Ò²¿ÉÄÃÀ´ÓÃÓà . Óà chsh
¿É¸Ä±äÄãµÄ login shell .
ΪÁË security ·½ÃæµÄ¿¼Á¿ , ¸÷λ¿ÉÒÔ°²×° shadow , ½« passwd Õâ¸öµµ
ÍêÈ«µÄÓëÒ»°ã user ¸ô¾ø¿ªÀ´ , Á¬¶ÁҲûÓа취¶Á passwd Õâ¸öµµ .
/etc/profile : profile Õâ¸öµµÊÇ bash Õâ¸ö shell ËùÓÃµÄ , profile Ö®ÓÚ bash
¾ÍºÃÏñ cshrc Ö®ÓÚ csh. ͬÑùµÄ, /etc Ï嵀 profile Ò²ÊÇ SA ÔÚά
»¤µÄ, Ö÷ÒªÊÇ·ÅÖøÈ«ÓòµÄÉ趨 ( Global Setting ) ¶øÿ¸ö user ÔÚ
×Ô¼ºµÄ Home Directory ¶¼¿ÉÒÔÓи÷È赀 .profile
/etc/protocols : ¼ÙÈçÄãΪÁËijЩĿµØ , ¶øдÁË×Ô¼ºµÄ protocol , ÄÇÄã¾Í±ØÐë°Ñ
ËüÁÐÔÚÕâ¸öµµ°¸ÖÐ , ÕâÑù inetd ²Å»á¹ÜÀíһЩ daemons È¥ÓÃËü
Õâ¸öµµ°¸Ã¿ÁеĸñʽÈçÏ , µ±È» , # Ö®ºóµÄÊÇ×¢½â :
Protolcol Name Portocol Number Aliases
ip 0 IP # internet protocol, pseudo protocol number
icmp 1 ICMP # internet control message protocol
igmp 2 IGMP # internet group multicast protocol
ggp 3 GGP # gateway-gateway protocol
tcp 6 TCP # transmission control protocol
pup 12 PUP # PARC universal packet protocol
udp 17 UDP # user datagram protocol
idp 22 IDP # WhatsThis?
raw 255 RAW # RAW IP interface
/etc/psdatabase : Õâ¸öµµ°¸ÊDZ» psupdate ËùÓõ½ , psupdate Ö÷ÒªµÄ¹¦ÄܾÍÊǸüÐÂ
/etc/psdatabase Õâ¸öµµ , ÒÔ·ûºÏÄ¿Ç°µÄ kernel image system
map file . Ò»°ãµÄÔ¤ÉèµµÊÇ /usr/src/linux/tools/zSystem .
/etc/resolv.conf : ÕâÀïÃæ¼ÇÔØÖøÄã»úÆ÷µÄ domain name ¼° name server µÄ IP
address , name server ¿ÉÒÔ×Ô¼º¼ÓÈë , ÔÚ½»´ó¿ÉÒÔÓÃ
140.113.1.1 »ò 140.113.17.5 , ÕâÁ½Ì¨¶¼ÊÇ name server .
name server ¿É²»ÒªËæ±ã¾ÍÈ¥µô , ·ñÔò , ¾Í»á·¢ÉúÈçϵÄÇé¿ö :
@Rebel[/etc]>telnet ccsun3.cc.nctu.edu.tw
ccsun3.cc.nctu.edu.tw: Host name lookup failure
ÒòΪûÓÐÁË name server , ËùÒÔ ccsun3.cc.nctu.edu.tw
ûÓа취±»½âÒë , ¹Ê»áÓÐ Host name lookup failure
Õâ¶ÎѶϢ .
/etc/securetty : ¼ÙÈçÄãÒªÒÔ root login µÄ»° , ʵ¼ÊÉÏÊÇÓÐÏÞÖÆµÄ , Õâ¸öµµ°¸¾Í
ÁгöÁË root ¿ÉÒÔ login µÄ ttys , ¼ÙÈçÄã°ÑÿһÁж¼ mark ÆðÀ´
ÄǾÍûÓÐÈκÎÒ»¸ö terminal ¿É¹© root login ÁË , ËùÒÔÄØ ,
¾Í»á³öÏÖÒÔϵÄÇé¿ö :
Rebel login: root
root login refused on this terminal.
ÔÙÒ»´ÎµÄ , ÎÒÃÇ¿´µ½ÁË unix security ·½ÃæµÄ¶«Î÷ , ×ÐϸµÄÔÚÕâ
¸öµµ°¸Áгö¿ÉÓÃµÄ terminal , ¿Éʹ´Ó modem Á¬µÄʹÓÃÕß»ò¾ÓÉÍø
·À´µÄÆäËüµÄʹÓÃÕ߱Ƚϲ»ÈÝÒ×È¡µÃ superuser µÄȨÁ¦ .
/etc/services :
/etc/shell : Õâ¸öµµ°¸ÔÙ¼òµ¥Ò²²»¹ýÁË , ÀïÃæ¾Í¼Ç¼Öø¿ÉÒÔÓÃµÄ login shell . »¹
ÓÐÒ»µã , ÄǾÍÊÇÕâ¸öµµµÄ¼Ç¼»áÔÚʹÓà chsh ʱ×öΪ²Î¿¼ , ΨÓб»ÁÐ
ÔÚÕâÀïµÄ shell , ʹÓà chsh ʱ²Å»á³öÏÖÕâЩ shell ¿ÉÑ¡ .
/etc/sudoers : ÔÚÒ»¸ö²»ÊǺܸ´ÔÓµÄϵͳÖÐ , Ò²ÐíÒ»¸ö System Administrator ¾Í¿É
ÒÔ¹ÜÀíËùÓеÄÊÂÇé . µ«Ò»µ«ÏµÍ³ÌṩµÄ·þÎñ±ä¶à , ϵͳ¹ÜÀíµÄ¹¤×÷
Ò²ËæÖ®±äµÃ³ÁÖØ , Õâʱºò , sudo ¾ÍÅÉÉÏÓó¡ÁË , sudo ¿ÉÒÔÈÃÒ»¸ö
ÆÕͨµÄ user ±ä³É superuser , ÕâÑùÒ»À´ , Ò»¸öϵͳµÄijЩ¹¤×÷ ,
¾Í¿ÉÒÔ·ÖÅä¸øÕâЩ superusers À´×ö . ÒÔ¼õÇḺµ£ .
µ±È» , ²¢²»ÊÇÿ¸ö user ¶¼¿ÉÒÔ±ä³É superuser . ËùÒÔ
/etc/sudoers ¾ÍÊǼǼÖøÄÇЩÈË¿ÉÒÔÓà superuser µÄÉí·ÝÀ´Ö´ÐÐÒ»
Щ¹¤×÷ , Õâ¸öµµ°¸µÄ¸ñʽÈçÏ :
host alias section format:
Host_Alias HOSTALIAS = host-list
Host_Alias ::= a keyword.
HOSTALIAS ::= an upper-case alias name.
host-list ::= a comma separated list of hosts.
command alias section format:
Cmnd_Alias CMNDALIAS = cmnd-list
Cmnd_Alias ::= a keyword.
CMNDALIAS ::= an upper-case alias name.
cmnd-list ::= a comma separated list commands.
user specification format:
user access_group [: access_group] ...
access_group ::= host_type = [op]cmnd_type [,[op]cmnd_type] ...
host_type ::= a lower-case host name OR a host alias.
cmnd_type ::= an command OR a command alias.
op ::= the logical ''!'' NOT operator.
ÈçÏÂÃæÊÇÒ»¸ö¼«Îª¼òµ¥µÄÀý×Ó :
# Cmnd alias specification
Cmnd_Alias SHUTDOWN=/sbin/halt,/sbin/shutdown
# User specification
root ALL=ALL
jhhsu ALL=ALL
emotion ALL=ALL,!SHUTDOWN
ÔÚÕâ¸öÀý×Óµ±ÖÐ , jhhsu ¿ÉÒÔÖ´ÐÐ root ËùÓеÄÃüÁî , emotion ³ýÁË halt
¼° shutdown ²»ÄÜÖ´ÐÐÒÔÍâ , ÆäËü root ÄÜÖ´ÐеÄÃüÁîËû¶¼ÄÜÖ´ÐÐ .
Õâ¸öµµ°¸ÓÐÒ»¸öרÊôµÄ editor ½Ð visudo ¿ÉÀ´±à¼ /etc/sudoer Õâ¸öµµ°¸
ÔÚ±à¼ÍêÕâ¸öµµ°¸Ö®ºó , jhhsu ¾Í¿ÉÒÔÓà sudo.bin Õâ¸öÃüÁîת»»³É
superuser À´×öÔÀ´Ö»ÓÐ superuser ²ÅÄÜ×öµÄÊ . ¶ø¹ØÓÚʹÓà sudo.bin
ÓÐÒ»¸ö¼Ç¼µµ , ÔÚ /var/adm/sudo.log , ÀïÃæ¼Ç¼ÖøËÔÚʲôʱºòÀûÓÃ
sudo ÏÂÁËÄÇЩָÁî . ˳±ãÒ»ÌáµÄÊÇ : ÀûÓÃÏÂÃæÕâ¸öÃüÁî¿É×¥³öÄÇЩÈËת»»
³É superuser µ«È´Ã»Óгɹ¦ ......
grep "FAILED SU" /var/adm/messages/etc/utmp : ´Ó utmp ÖпÉÒÔ
ÖªµÀÏÖÔÚÓÐËÕýÔÚÓÃϵͳ . µ±Ê¹ÓÃÕß logout Ö®ºó ,
init ( ºÜÖØÒªµÄ process , ÒÔºóÓÐʱ¼ä½«Îª¸÷λ½éÉÜ ) ¾ÍÈ¥°Ñ logout
µÄʹÓÃÕß´Ó /etc/utmp ÖÐÈ¥µô .
ʵ¼ÊÉÏ , utmp ÿ¸ö record ÊÇÏñÕâÑùµÄÒ»¸ö½á¹¹ :
struct utmp {
short ut_type; /* type of login */
pid_t ut_pid; /* pid of process */
char ut_line[12]; /* devicename of tty -"/dev/" */
char ut_id[2]; /* init id or abbrev. ttyname */
time_t ut_time; /* logintime */
char ut_user[8]; /* username, not null-term */
char ut_host[16]; /* hostname for remote login */
long ut_addr; /* IP addr of remote host */
};
Á˽âÕâ¸öµµ°¸ , ½ø¶øÈ¥ÐÞ¸Ä , ¿ÉÒÔ×ö³öÐí¶àÓÐȤµÄÊ ......:P
/etc/wtmp : ¼ò¶øÑÔÖ® , wtmp ÊÇÒ»¸ö login data base , ÓÐÐí¶àµÄÖ¸Áî»áÓõ½Õâ¸ö
µµ , Ïñ last , sessreg , who µÈ ......
Õâ¸öµµ°¸¸ñʽÓë utmp ´óÖÂÏàͬ , Ö»ÊǶàÁË shutdown ¼° reboot Õâ
¸ö¼Ç¼ , Ö¸³öϵͳµÄ shutdown »ò reboot , ¼°Ò»¸ö¿ÕµÄ user name
Ö¸³öÔÚÏà¹Ø terminal µÄ logout . »¹ÓÐ , ²»Ïñ /etc/utmp , /
/etc/wtmp µÄ¼Ç¼ÊÇÂýÂýµÄ¸½¼ÓÉÏÈ¥µÄ , Ò²¾ÍÊÇ˵ , Õâ¸öµµ°¸»áÔ½±ä
Ô½´ó , ËäÈ»±ä´óµÄËٶȲ¢²»»áÌ«¿ì , µ«Ò»µ«µ½ÁËijÖ̶ֳȴóСµÄ»°
System Administrator Ó¦¸ÃÒª¿¼ÂÇ¿³µô²¿·Ý . ÏÂÃæÊÇÓà last Õâ¸ö
Ö¸ÁîËùµÃµ½µÄ²¿·ÝÄÚÈÝ :
bbs tty1 Tue Nov 29 19:09 - 19:09 (00:00)
root tty1 Tue Nov 29 19:08 - 19:09 (00:00)
root tty1 Tue Nov 29 19:07 - 19:07 (00:00)
runlevel ~ Tue Nov 29 19:07
reboot ~ Tue Nov 29 19:07
/etc/zprofile : link µ½ /etc/profile
picture ÓÚ 2006-12-24 18:31:08·¢±í:
:ha3nd
·Ç³£¸Ðл
redersun ÓÚ 2006-03-16 22:44:10·¢±í:
ºÜÏêϸ,²»´í,ÆÚ´ý×ÅÏÂÎÄ!