File Introduction toETC in FreeBSD

zhaozj2021-02-16  60

FreeBSD's files under ETC can be said to be complicated, nothing to familiarize, but for a newcomer. . . Too mess, the following is some of the roles and configuration methods of the configuration files that are often used, I am willing to help you.

1. AliaSs 2. Crontab 3. Csh.cshrc 4. Csh.login 5. Csh.logout 6. Daily 7. defaultDomain 8. Exports 9. FBTAB 10.FSTAB 11.FTPUSERS 12.Group 13.host.conf 14.hosts 15.Netd.conf 16.localtime 17.login.conf 18.make.conf 19.monthly 20.motd 21.netStart ---- New version has been renamed to /etc/rc.network 22.Passwd 23.Printcap 24.profile 25.rc 26.rc.conf ---- instead of the original / etc / sysconfig 27.rc.conf.local - instead of the original /etc/rc.local 28.rc.i386 29.rc.local- --- The new version is renamed to /etc/rc.conf.local 30.rc.network --- instead of the original / etc / netstart 31.resolv.conf 32.Services 33.Shells 34.sysconfig ---- New version has already Rename /etc/rc.conf 35.syslog.conf 36.Termcap 37.tttys 38.weekly

Aliases

This file mainly tells Sendmail which user wants to send the trip, or which program is handed over.

Such as. Root: user1, name2, user3 usnet: "| /usr/local/bin/mail-post.pl"

As example, Sendmail will send the originally sent root to USER1 and Name2 and USER3, and the letter sent to the USENT is handled by Mail-Post.pl.

After you modified, remember to execute "newaliases" to update /etc/aliases.db

For details on AliaSes, please manually query.

2. crontab

This is a crontab file for root, you can also kill this file to replace "crontab -e". The format is as follows ...

# 分 时间 天 天 礼 礼 礼 身 * / 5 * * * * root / usr / libexec / atrun

Minute: Minute: Range from 0 to 59 hours: Hours / Day, range from 0 to 23 MDAY: Tian / month, range from 0 to 31 months: month / year, range from 0 to 12 WDAY: day / week, The range from 0 to 7 (0, 7) WHO: Table is to execute this Command as (this only for / etc / crontab is useful, crontab-E Non-this field) Command: command or shell script

* / N: Indicates that every N is calculated, as in the hour, * / 3 refers to 0, 3, 6, 9, 12

Please man 5 crontab to see a detailed description.

3. csh.cshrc

# 系统 系统 内 给 c......

## Determine Home Directory Stenv Home $ Home Set Home = $ HOME CD $ HOME

## 案 权限 设 u umask 022

## 是 a 嘛 a a | | | | | n | | | | | | | | | | | ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, Alias ​​rwho '/ usr / bin / rwho -a | grep -v login' Alias ​​More Less Alias ​​ZMORE ZLIAS M LESS ALIAS PSS 'PS AUXW | SORT -K 2 | GREP $ User' Alias ​​PSM 'PS AUXW | SORT -K 1,2 | More 'Alias ​​PSL PSM Alias ​​PSV' PS AUXW | GREP -V $ USER | SORT -K 2 | More 'Alias ​​D' / usr / local / bin / colorls -g -alfgk /! * | More 'alias Dir '/ usr / local / bin / colorls -g -alfgk /! *' alias rd RMDir alias md mkdir alias cls clear alias cd .. 'cd ..' alias del '/ bin / rm -i' alias xdel '/ BIN / RM-RF 'Alias ​​MV' MV -I 'Alias ​​Dir / W' / Bin / Ls -afgk 'Alias ​​DW' / BIN / LS --AFGK '#alias x' (StartX &)> & / dev / console Sleep 300; Lo '#alias lpr' lpr -m 'alias cp' cp -i 'alias rm' rm -i 'alias lo' clear; exit 'alias Bye' clear; exit '#alias vi cvi alias unlo' unset autologout Unstenv Autologout 'Alias ​​Q Joe Alias ​​..' cd .. 'alias ...' cd ../. '#alias ku' ku -w 'ali As Tin Rtin #alias s 'exec screen'

## Environment Setting SET PATH = (/ sbin / usr / sbin / bin / usr / bin / usr / local / sbin / usr / local / bin) set path = ($ PATH / ETC / USR / ETC / USR / LOCAL / etc) set path = ($ path / usr / x11r6 / bin / usr / games) set path = ($ PATH ~ ~ / BIN.) Set mail = (10 / var / mail / $ user) set receXact set AutoList Set Matchbeep = Ambiguous Set AutoexPand Set AutoCorRect Set IgnoreOf Set NoClobber Set Notify Set Correct = All if (! $? Window) THEN # set prompt = "% b% M [% /] [%?] -% N-" set proMpt = "% B% M [% /] -% N-" Else set prompt = "% B% M [% /] -% N- [w $ window]" endif set propt2 = "(% T% M)% ~ # %% "set prompt3 ="% SDO you mean [% r] (y / n / e)? "Set history = 500 set savehist = 500 set time = 100 #set Watch = (1 any any) set symlinks = ignore Set ListLinks Set ListJobs Set RMSTAR SET Showdots #set tperiod = 30 # set autologout = (60 2) #setenv manpath / usr / man: / usr / local / man: / usr / man / preformat: / usr / x11 / man: / usr / openwin / man setenv editor / usr / local / bin / joe setENV Visual / usr / local / bin / joe setENV EXINIT 'SET A i 'setenv LESS "-EsPm-LESS-" setenv LESSCHARDEF "8bcccbcc18b95 .." setenv PAGER "less -Em" #setenv PAGER more setenv LC_CTYPE lt_LN.ISO_8859-1 setenv LANG C setenv BLOCKSIZE 1k setenv MACHINE_ARCH i386 setenv MACHINE i386 setenv ORGANIZATION "Jiaotong University Adonis" ## 相关 相关 Setting setENV xwinhome '/ usr / x11r6' setENV X11HOME '/ usr / x11r6' setENV openwinhome '/ usr / x11r6' setENV xkeysymdb / usr / x11r6 / lib / x11 / xkeysymdb setENV XNLSPATH / USR / X11R6 / LIB / X11 / NLS #setenv ld_library_path / usr / lib: / usr / x11r6 / lib: / usr / local / lib sttylere '^?'

IF ($? term) Then IF ($ TERM == "xterm" || $ term == "xterms") THEN STTY ERASE '^ h' Endif Endif ## 七 八 设 设 #set Term = VT100 #set Term = VT100 #setenv Term VT100 #Stenv Term VT100 #Stty Extb stty 38400 stty crat stty -tabs stty -istrip stty pass8 unlo #bindkey "[home]" beginning-of-line #bindkey "[ESC]" Keyboard-Quit Limit Coredumpsize 0

# Give FSP Client with setENV FSP_PORT 21 Setenv fsp_host nctucca.edu.tw setENV fsp_dir / setENV FSP_TRACE STENV FSP_DELAY 3000

# Aii .. is fsp aliases :) Alias ​​Fcat '(Set Noglob; Exec Fcatcmd /! *)' Alias ​​FCD 'STENV FSP_DIR `(Set Noglob; Exec Fcdcmd /! *)`; Fpwd' Alias ​​FDU / (Set Noglob / ; EXEC FDUCMD /! / * /) Alias ​​FFIND / (EXEC FFINDCMD /! / * /) Alias ​​Fget '(Set Noglob; Set Noglob; EXEC FGRABCMD /! *) 'Alias ​​fls' (set noglob; exec flscmd -f /! *)' Alias ​​flscmd -l /! * 'Alias ​​fdir' (set noglob; exec flscmd -l /! *) 'Alias ​​Fmore / (Set Noglob /; EXEC FCATCMD /! / * / | More /) Alias ​​FPRO' (Set Noglob; Exec FPROCMD /! *) 'ALIAS FPWD' Echo "$ fsp_host ($ fsp_port): $ fsp_dir" ' Alias ​​frm '(set noglob; set noglob; exec frmdircmd /! *)' alias fhost 'setENV fsp_host /! *; setENV FSP_DIR /'

4. csh.login

# 系统 内 内 的 .login file.

#stty extb stty 38400 #stty crt #stty -tabs stty -istrip stty pass8

# MESG Y IF Not Console Mesg Y IF (`TTY | CUT -C 6-` == Console) THEN MESG N Endif

MSGS-FP

5. csh.logout

# 系统 内 内 的 .logout clear.

6. Daily

CRON will do every day for every day in accordance with the / etc / crontab. Pay attention to some Commands cause a lot of load to your hard drive, like the last line of "sh / etc / security", he will record from your root Start inquiry. You can add someone you want to execute every day, like "quotacheck -a", "bin / rm / -f /tmp*junk*.7. DefaultDomain

This archive records your DomainName, you are useful when you run YP (NIS). Of course, you fill a fill.

8. exports

This file defines which directories can be used by NFS. For example, / cdrom -ro host1, host2 / home -maproot = root host3

NOTICE: If you don't add "-ro", you can write it, so you should be careful.

After completing the correction, "KILL -1 $ mountd_pid", then use "ShowMount -e" to see if NFS is doing the correct. If it is wrong, use "Tail / Var / Log / Messages" to see the error message.

You should set NFS_CLIENT_ENABLE in /etc/rc.conf, NFS_SERVER_ENABLE to YES.

Detailed instructions please man 5 exports.

9. FBTAB

/ dev / ttyv0 0600 / dev / console / dev / ttyv1 0600 / dev / console / dev / ttyv2 0600 / dev / console / dev / ttyv3 0600 / dev / console # / dev / ttyv0 0600 / dev / pcaudio: / dev / PcaudiocTl

10.FSTAB

This archive definition When you turn it on, you want MOUNT which partition. For example.

/ DEV / SD0A / UFS RW 1 1 / DEV / SD0E / DOS MSDOS RO, -GMSDOS, -M750 1 1 / DEV / SD0G / USR / LOCAL UFS RW, Userquota 1 1 / dev / SD0H / HOME UFS RW, Userquota, Groupquota 1 1 / DEV / SD0B None Swap SW 0 0 PROC / PROC Procfs RW 0 0 Kern / Kern Kernfs RW 0 0

For details, please man fstab.

If your / usr does not follow / put it together, pay special attention, / usr cannot be placed behind the filesystem loaded using LKM. For example, your MSDOSFS is loaded with LKM (that is, you didn't compile MSDOSFS in Kernel), your / dos must be placed behind / usr, otherwise the opportunity failed, for example:

MODLOAD: EXEC (/ USR / BIN / LD): No Such File or Directiory MSDOS: VFSLOAD (MSDOS): Operation Not Permitted Filessystem Mount Failed, Startup Aborted Enter Pathname of Shell Or Return for SH

11.ftpusers

This file indicates that users will not be ftp this machine. Just write username. It is a blacklist that is forbidden from FTP.

12.Group

This file mainly records the Group name, Group ID, and users belonging to the group.

Remember that in FreeBSD, only the user who belongs to WHEEL Group can SU into root.

Special pay special attention to the USR / SRC / ETC / Group in USR / SRC / ETC / Group, such as NetWork, is the newly added group. Please use Man Group.

13.host.conf

This archive determines the order of DNS-Name-Lookup. You'd better "Hosts" first, second "bind", and finally use "NIS".

Hosts: Self / etc / hosts query. Bind: Since Nameserver (Reference /etc/resolv.conf Setting) query. NIS: Since the NIS Server query.

14.hosts

This archive records the IP and Hostname you need, and minimize localhost and your own hostname, usually provide a query taken priority to Nameserver, or no query when Nameserver.

The format is as follows: ip-addr full-hostname alias is as. 123.456.789.123 Heaven.net.com HEAVEN

Please man hosts to see a detailed description.

15.inetd.conf

This archive defines the services provided by inetd, and should be consistent with / etc / services.

When you modify this file, remember to know the inetd to re-update the information.

You can install TCP-WRAPPER (TCPD) to increase security.

16.localtime

This file describes your time zone information, you can choose a suitable for use from / usr / share / zoneinfo.

For Taiwan, you should use / usr / share / zoneInfo / asia / Taipei, normal, automatically, will automatically use this file COPY to / etc / localtime when INSTALL.

17.login.conf

This file can control the limitations of system resources and accounts, or set up the environment variables.

"man login.conf" for detail.

18.make.conf

This definition file will be referenced when you use Make.

If you are not written in BSD format, you should install Gmake (GNU)

19.monthly

Monthly routine JOBS.

20.motd

Message Of Today, as the name suggests, is the picture that appears when you login.

If you have your own MOTD, you have to change the MOTD command when you start the /etc/rc.local, otherwise you will be changed every time you start MOTD.

21.netStart ---- New version has been renamed /etc/rc.network

This file has now been replaced by /etc/rc.network. This file is currently only used as root in Single User Mode To manually start online service. This file should not be more movable, should be modified /etc/rc.conf

22.passwd

/ etc / passwd /etc/master.passwd /etc/spwd.db /etc/pwd.db is generated by VIPW. For how to build an account, please refer to How-to-Adduser.

You can detail the man passwd, vipw, chpass, and chfn query.

23.PrintCap

This archive defines the settings of the press. After the modification, try to use LPR to print some things, if you feel very slow, try to change / dev / lpt0 to the Poll mode with lptcontrol -p, of course, you can Add LPTControl -P to /etc/rc.local to make each boot is valid.

Man lptControl query details.

24.Profile

This is the default setting of / bin / sh.

25.rc

When the system is turned on, KERNEL will go to load / sbin / init, and then / sbin / init will perform / etc / rc, so / etc / rc is as if the DOS is as Autoeexec.Bat. This file does not change If you don't want each time you turn it on / TMP will be cleared in Qing Emperor, then you can cut off a few lines related to / TMP. (Personal preference) 26.rc.conf ---- instead of the original / etc / sysconfig

This is mainly used to make the environmental settings when the system is turned on. / Etc / rc, /etc/rc.i386, /etc/rc.conf.local, /etc/rc.network, / etc / [blala] This archive can be said to be very important.

Most of the annotations, the following lists are listed below ... 1) Hostname: Your full hostname (FQDN: like freebsd.csie.nctu.edu.tw) 2) Network_interfaces: DEVICE NAME, like "ed0 lnc0" 3) ifconfig_xxx:.. a network card and ip address is defined such ifconfig_ed0 = "inet 140.113.145.1 netmask 0xffffff00" ifconfig_ed1 = "inet 140.113.190.1 netmask 0xffffff00" as follows ... ifconfig_ $ device -Name = "INET $ IP NetMask $ Netmask", Netmask 0xffffff00 is 255.255.255.0 Table Class C Network. 4) DefaultRouter: Contact ROUTER IP. (such as: 140.113.122.254) 5) RoutdFlags: Usually NO. But if you If you want to run ROUTED, use "-s" or "-q". Detailed instructions please man routed. 6) RWHOD: YES Execute rwho daemon. Rwho with RUPTIME THEMON. 7) Sendmail_Flags: Perform sendmail daemon, usually set to "-db -q30m" 8) nfs_ *: performing nfs client or server 9) check_quotas: enable file system quotas 10) accountint: enable command accounting, "lastcomm" needs 11) firewall_enable:. enable firewall functions firewall_type: Specifies the firewall form

You should set it back to test whether each change is in touch with you.

27.rc.conf.local ---- instead of the original /etc/rc.local

Add your personal settings in this file, you can put the action you want to perform when you are booting here. Like Gopherd, LPTControl, Swap-on-File, etc.

28.rc.i386

This file should not be more.

29.rc.local ---- New version is renamed /etc/rc.conf.local

The new version has been replaced by /etc/rc.conf.local.

30.rc.network ---- instead of the original / etc / netstart

All settings for the network are set by /etc/rc.conf, in principle, this file does not need to be more

31.Resolv.conf

This defines the order of DNS query Nameserver.

1. Domain: Let your domainname here. 2. Nameserver: put your nameseervers here, the most in front will be mainly Nameserver. 3. Search: put DomainNames here, when you don't enter your full hostname, He will add DomainNames. For example: Search csie.nctu.edu.tw nctu.edu.tw edu.tw Tw Details Please man Resolver.

32.Services

Define the service name and port. No need to be done.

33.SHELLS

All shells should be placed in this archive, like / bin / sh, / bin / tcsh, / home / bbs / bin / bbsrf, etc.

If there is a user's shell not listed in this file, some programs will refuse the user FTP, such as addUser, will refuse to execute.

Man shells query detailed instructions.

34.sysconfig ---- New version has been renamed /etc/rc.conf

Refer to rc.conf.

35.slog.conf

This archive indicates where the system's log should be stored.

36.Termcap

This should be link to / usr / share / misc / termcap.

37.ttys

Define TTY forms and some TTY allows root login. If some TTYS is added to "Secure", it means root can log, you should add more, such as / dev / tty [pqrs] [0-9a-v]

For details, please man Ttys.

38.Weekly

Every week, routine work.

转载请注明原文地址:https://www.9cbs.com/read-12758.html

New Post(0)