Ocenite etot tekst:

---------------------------------------------------------------
 Origin: http://www.linux.ru.org/books/uucp.html
---------------------------------------------------------------
Victor Sudakov
vas@vas.tsu.tomsk.su
Versiya 1.1, Data poslednego obnovleniya 1998/3/8

UUCP (Unix to Unix copy) prednaznachen dlya kopirovaniya fajlov mezhdu mashinami i dlya vypolneniya komand na udalennoj mashine. Ego ispol'zovanie dlya peredachi pochty - tol'ko odno iz vozmozhnyh primenenij.

Hastoyashchee rukovodstvo orientirovano na FreeBSD i Taylor UUCP, v drugih sistemah vse mozhet byt' sovsem po-drugomu :-)

Predstavim sebe, chto vy yavlyaetes' uzlom, kotoryj obmenivaetsya pochtoj s vneshnim mirom cherez host mail.provider.ru i razdaet pochtu eshche trem hostam: host1.your.domain.org, host2.your.domain.org, host3.your.domain.org. Ves' obmen pochtoj proishodit po uucp. Pri etom host1.your.domain.org, host2.your.domain.org, host3.your.domain.org zvonyat vam, a vy zvonite mail.provider.ru.

Budem schitat', chto chetyre mashiny, s kotorymi vam predstoit naladit' obmen pochtoj po uucp, imeyut sleduyushchie uucp-imena: provider, host1, host2 i host3 sootvetstvenno. Voobshche-to domennoe imya sistemy (hostname) i uucp-imya etoj zhe samoj sistemy sovershenno ne obyazany sovpadat'. Haprimer, host2.your.domain.org vpolne mog by imet' uucp-imya foo ili bar. Esli my zdes' i vybrali sovpadayushchie imena, eto bylo sdelano tol'ko dlya udobstva izlozheniya.

Pust' vashe sobstvennoe domennoe imya budet yourhost.your.domain.org, a vashe uucp-imya budet yourhost.

Hastrojka uucp pochty v Unix podrazumevaet sleduyushchie shagi:

  • nastrojka sobstvenno uucp;
  • nastrojka sendmail;
  • raznoe.

    1. Hastrojka sobstvenno uucp

  • CHtoby nastroit' uucp, nado nastroit' ego konfigi. Vot oni:
    total 12
    drwxrwx---   3 uucp  uucp    512 15 noya 16:23 ./
    drwxr-xr-x  10 root  wheel  2048 30 dek 21:44 ../
    -r--r-----   1 uucp  uucp     61 23 yanv  1997 call
    -r--r-----   1 uucp  uucp    260  8 apr  1997 config
    -rw-r-----   1 uucp  uucp    250  3 sen 20:51 dial
    -r--r-----   1 uucp  uucp      1 25 avg  1996 dialcode
    -r--r-----   1 uucp  uucp     14 21 apr  1997 passwd
    -r--r-----   1 uucp  uucp     96 29 maj  1997 port
    drwxr-xr-x   2 root  uucp    512 15 noya 12:08 samples/
    -r--r-----   1 uucp  uucp    160 28 maj  1997 sysin
    -r--r-----   1 uucp  uucp    366 16 noya 16:06 sysout
    

    1.1 call

    V etom fajle opisyvaetsya vash login i parol' dlya prozvonki na drugie uucp-mashiny. Estestvenno, login i parol' nado poluchit' ot administratora toj mashiny, na kotoruyu vy sobralis' zvonit'. V nashem sluchae on budet vyglyadet' primerno tak:

    ======= call  ======
    
    # system     login      password
    provider uuyourhost Your_Secret_Password
    
    ======= call  ======
    

    1.2 config

    V etom fajle opisyvayutsya razlichnye parametry uucp, v osnovnom puti i imena fajlov, tut pochti nichego ne nado menyat'. V osnovnom etot fajl nuzhen, esli nuzhno pereopredelit' nekotorye umolchaniya, kotorye byli zadany pri kompilyacii.

    ======= config  ======
    
    nodename yourhost # zdes' nado ukazat' vashe sobstvennoe uucp-imya
    spool /var/spool/uucp
    pubdir /var/spool/uucppublic
    logfile /var/spool/uucp/Log
    statfile /var/spool/uucp/Stats
    debugfile /var/spool/uucp/Debug
    sysfile sysin sysout # imena fajlov s opisaniyami sistem - vashih linkov
    portfile port
    dialfile dial
    dialcodefile dialcode
    callfile call
    passwdfile passwd
    # kolichestvo odnovremenno vypolnyaemyh processov raskladki pochty
    max-uuxqts 1
    
    ======= config  ======
    
    Poslednij parametr podskazal mne Igor Nikolaev (2:5030/266@fidonet). |to dejstvitel'no bolee krasivoe reshenie problemy, ot kotoroj ya izbavilsya tol'ko peresborkoj rmail s flagom -DQUEUE_ONLY. A problema vot kakaya: pri poluchenii bol'shogo kolichestva pochty zapuskaetsya srazu kucha sendmail'ov, i eto poluchaetsya ochen' nakladno dlya resursov.

    1.3 dial

    |to fajl s opisaniyami modemov. Beru ego bez izmenenij so svoej sistemy, imho tut i tak vse ponyatno. Polezno takzhe posmotret' man chat i rukovodstvo k svoemu sobstvennomu modemu.
    ======= dial  ======
    
    dialer idc # proizvol'noe imya modema, pod kotorym on budet izvesten uucp
    dialtone w
    pause ,
    #chat "" ATZ\r\d\c OK ATM0DPW\T CONNECT \p\c
    chat "" ATZ\r\d\c OK ATM0DT\T CONNECT \p\c
    chat-fail BUSY
    chat-fail ERROR
    chat-fail NO\sDIALTONE
    chat-fail NO\sCARRIER
    #complete \d\d+++\d\dATH\r\c
    #abort \d\d+++\d\dATH\r\c
    
    ======= dial  ======
    
    Obratite vnimanie, chto poslednie dve strochki zakommentareny. Esli modem umeet sam klast' trubku po okonchanii soedineniya ili po opuskaniyu DTR, oni ne nuzhny. Esli ih ostavit', vreda oni ne prinesut, prosto uucp budet v logah rugat'sya. Eshche hochu zametit' - opisanij modemov mozhet byt' skol'ko ugodno, estestvenno, pod raznymi imenami.

    1.4 dialcode

    Sluzhit dlya hitrogo nabora nomera i imho voobshche ne nuzhen. U menya imeet nulevuyu dlinu.

    1.5 passwd

    V etom fajle soderzhatsya login i sootvetstvuyushchij emu parol' dlya teh sistem, kotorye budut zvonit' vam. 'uucico -l' samo umeet avtorizovat' pozvonivshih pol'zovatelej, predlagaya im pri etom vvesti login i parol', i proveryaet vernost' parolya po etomu fajlu. Kakie loginy i paroli vy dadite svoim daunlinkam - delo vashe. Uchtite tol'ko, chto udobnee i pravil'nee dat' im loginy, kotorye nachinayutsya odinakovo, naprimer, s dvuh bukv uu. Pochemu eto tak - ob®yasnitsya pozzhe. Primer:
    ======= passwd  ======
    
    uuhost1       Top_Secret_Password
    uuhost2       Smart_Password
    uuhost3       Stupid_Password
    
    ======= passwd  ======
    

    1.6 port

    V etom fajle soderzhitsya opisanie portov. Portov mozhet byt' mnogo. Kazhdyj port imeet svoe imya, kotoroe i ispol'zuetsya v dal'nejshem v fajlah s opisaniyami sistem - vashih linkov. Imho tut vse ponyatno. Habor parametrov ne ogranichivaetsya nizheprivedennym primerom, esli nado sdelat' chto-nibud' osobenno hitroe - chitajte opisanie k Taylor UUCP.
    ======= port  ======
    
    port port1 # imya porta
    type modem
    device /dev/cuaa1
    dialer idc
    speed 38400
    
    port port2 # tozhe imya porta
    type tcp
    service 540
    
    ======= port  ======
    

    1.7 sysin

    |to fajl s opisaniyami sistem, kotorye budut zvonit' vam.
    ======= sysin  ======
    
    call-login *
    call-password *
    local-send /
    local-receive /
    port port1 # eto, kak vy pomnite, u nas modemnyj port
    chat-timeout 90
    protocol g # vozmozhno, vy zahotite ispol'zovat' kakoj-nibud' drugoj protokol
    time never # zvonyat tol'ko oni, vy im nikogda ne zvonite
    debug 1
    
    system host1
    myname yourhost # kak vy predstavites' sisteme host1, kogda ona pozvonit
    called-login uuhost1
    
    system host2
    myname yourhost
    called-login uuhost2
    
    system host3
    myname yourhost
    called-login uuhost3
    
    ======= sysin  ======
    
    Zachem nuzhny pervye chetyre strochki i strochka called-login - ne sprashivajte. He pomnyu, no tak nado. V dokumentacii opisano, komu sil'no interesno - vpered.

    1.8 sysout

    V etom fajle udobno propisat' te sistemy, na kotorye vy sami sobiraetes' zvonit'. V dannom sluchae u nas tol'ko odna takaya sistema - vash provajder.
    ======= sysout  ======
    
    call-login *
    call-password *
    local-send /
    local-receive /
    port port1
    chat-timeout 90
    protocol g
    time any # zvonit' v lyuboe vremya. A voobshche vremya mozhno zadavat' ochen' gibko.
    debug 1
    
    system provider
    chat ogin: \L word: \P # beretsya iz fajla call
    phone 111111
    alternate # tak delaetsya perebor nomerov
    phone 222222
    alternate
    phone 333333
    
    ======= sysout  ======
    
    Korrektnost' nastrojki vseh konfigov mozhno proverit', zapustiv uuchk. Ostalas' eshche samaya malost'. CHtoby periodicheski zvonit' svoemu provajderu za pochtoj, vstav'te strochku v vash /etc/crontab, tipa:
    0 * * * * uucp /usr/libexec/uucp/uucico -S provider
    Kak prinimat' vhodyashchie zvonki po uucp, opisano v punkte 3.1

    2. Hastrojka sendmail

    2.1 Hastrojka sendmail.cf

    Heobhodimo sozdat' novyj sendmail.cf, kotoryj budet znat' pro uucp. Dlya ego sozdaniya mozhno vzyat' primerno vot takoj fajl-prototip:
    ====== uucp.mc =========
    
    divert(-1)
    include(`../m4/cf.m4')
    VERSIONID(`@(#)uucp.mc 1.01')
    OSTYPE(bsd4.4)dnl
    
    MAILER(local)dnl
    MAILER(smtp)dnl
    MAILER(uucp)dnl
    
    FEATURE(nodns)dnl
    FEATURE(nocanonify)dnl
    FEATURE(mailertable)dnl
    FEATURE(uucpdomain)dnl
    
    define(`SMART_HOST', `uucp-dom:provider')dnl
    define(`confCOPY_ERRORS_TO', `postmaster')dnl
    
    ====== uucp.mc =========
    
    Posle chego
    m4 uucp.mc > /etc/sendmail.cf

    Obratite vnimanie, chto MAILER(smtp) ubirat' nel'zya, dazhe esli nikakogo smtp ne predviditsya. On vse ravno nuzhen dlya togo, chtoby rabotal mejler uucp-dom. |to mejler, kotoryj znaet pro domennuyu formu imen - vam zhe ne hochetsya, chtoby adresa v pis'mah byli v formate uucp (cherez vosklicatel'nye znaki).

    2.2 Hastrojka mailertable

    Marshrutizaciya uucp pochty proishodit soglasno pravilam, opisannym v mailertable. Inache i nel'zya - ved' uucp nichego ne znaet pro DNS (hotya mejler uucp-dom i znaet pro imena mashin v domennoj forme). V prostejshem sluchae, chtoby prosto zalivat' pochtu svoemu provajderu, dostatochno budet mailertable v takom formate:
    ======= /etc/mailertable ======
    
    .  uucp-dom:provider
    
    ======= /etc/mailertable ======
    
    Gde provider - eto uucp-imya sistemy provajdera (sistema dolzhna byt' opisana v /etc/uucp/sysout) Tochka zdes' vystupaet v roli simvola podstanovki i oznachaet to zhe samoe, chto u normal'nyh lyudej oznachaet zvezdochka, to est' lyuboe kolichestvo lyubyh simvolov. Esli vy ne yavlyaetes' okonechnoj sistemoj, to est' razdaete pochtu komu-to eshche po uucp, to vash mailertable mozhet vyglyadet' tak:
    ======= /etc/mailertable ======
    
    .host1.your.domain.org    uucp-dom:host1
    host1.your.domain.org     uucp-dom:host1
    .host2.your.domain.org    uucp-dom:host2
    host2.your.domain.org     uucp-dom:host2
    .host3.your.domain.org    uucp-dom:host3
    host3.your.domain.org     uucp-dom:host3
    .         uucp-dom:provider
    
    ======= /etc/mailertable ======
    
    Odinochnaya tochka v konce oznachaet - vse ostal'noe svalivat' na provajdera, on sam razberetsya. Razumeetsya, rech' v mailertable idet tol'ko ob imenah mashin. Pro pol'zovatelej on nichego ne znaet. To est', zapisi
    host1.your.domain.org uucp-dom:host1
    .host1.your.domain.org uucp-dom:host1

    oznachayut tol'ko to, chto pochta dlya mashin

    host1.your.domain.org
    foo.host1.your.domain.org
    bar.host1.your.domain.org
    foo.bar.host1.your.domain.org

    i t.p. budet napravlyat'sya cherez uucp-sistemu host1. Ostalos' tol'ko dobavit', chto sendmail ispol'zuet mailertable v vide database map, poetomu ostalos' prodelat' sleduyushchee:

    makemap hash /etc/mailertable.db < mailertable

    2.3 Hastrojka uudomain

    Kak uzhe ukazyvalos' ranee, domennoe imya sistemy (hostname) i uucp-imya etoj zhe samoj sistemy sovershenno ne obyazany sovpadat'. Poetomu v fajle uudomain nastraivaetsya sootvetstvie domennogo imeni hosta i ego uucp-imeni. V etom fajle dolzhny byt' opisany vse sistemy, s kotorymi u vas est' pryamye linki po uucp. Pol'zuyas' nashim primerom, vash uudomain budet vyglyadet' primerno tak:
    ======= /etc/uudomain ======
    
    host1     host1.your.domain.org
    host2     host2.your.domain.org
    host3     host3.your.domain.org
    provider  mail.provider.ru
    
    ======= /etc/uudomain ======
    
    uudomain, tak zhe kak i mailertable, dolzhen byt' v vide database map, poetomu
    makemap hash /etc/uudomain.db < uudomain

    Teper' ostalos' tol'ko

    kill -1 `cat /var/run/sendmail.pid`

    3. Raznoe

    3.1 Hastrojka uucp-servera.

    Predpolagaetsya, chto vasha mashina yavlyaetsya pochtovym serverom, na kotoryj vashi klienty (host1.your.domain.org, host2.your.domain.org, host3.your.domain.org) budut hodit' za pochtoj. Hodit' za pochtoj oni mogut po telefonu ili po IP. Byt' serverom uucp ochen' prosto - kogda klient pozvonit modemom ili zajdet na 540 port, emu nado podsunut' uucico v kachestve shell. Luchshe podsovyvat' uucico s klyuchom -l, togda ono budet samo sprashivat' parol', a brat' paroli budet iz sobstvennogo fajla s parolyami (/etc/uucp/passwd). Kak eto sdelat' - sushchestvuet ryad sposobov.

    3.1.1 UUCP over IP

    Esli vasha mashina budet otdavat' pochtu po uucp over IP, to nado zakommentarit' v /etc/inetd.conf standartnuyu strochku, otnosyashchuyusya k uucpd, i dobavit' svoyu:
    uucpd stream tcp nowait root /usr/libexec/uucp/uucico uucico -l

    He znayu, pochemu po umolchaniyu tam stoit nerabotayushchaya strochka, no pogovarivayut, chto stoit ona tam v raschete na to, chto budet ispol'zovat'sya ne Taylor, a kakaya-to drugaya realizaciya UUCP.

    3.1.2 mgetty

    Esli klienty budut zvonit' po telefonu, proshche vsego postavit' mgetty, kotoraya umeet po standartnym imenam pol'zovatelej zapuskat' im v kachestve shell razlichnye programmki. Haprimer, vot takaya strochka v /usr/local/etc/mgetty+sendfax/login.config
    uu* uucp @ /usr/lib/uucp/uucico -l -u @

    oznachaet, chto dlya vseh pol'zovatelej s imenami, nachinayushchimisya na uu, mgetty budet zapuskat' uucico vmesto /usr/bin/login. CHem horosh takoj variant - v chastnosti tem, chto ne nado propisyvat' uucp-klientov v /etc/passwd. To est' uucico s klyuchom -l budet brat' parol' iz svoego fajla /etc/uucp/passwd

    3.1.3 /etc/passwd

    |tot variant ya lichno ne proboval, no dolzhen rabotat'. Kazhdogo uucp-klienta nado budet propisat' v /etc/passwd, pri etom ego strochka budet vyglyadet' primerno tak:
    uuhost1:*:66:66::0:0:host1 uucp
    system:/var/spool/uucppublic:/usr/libexec/uucp/uucico

    V etom sluchae dlya avtorizacii pozvonivshego budet ispol'zovat'sya ne /etc/uucp/passwd, a standartnyj mehanizm avtorizacii pol'zovatelej cherez /etc/passwd. Kak podskazyvaet Sergey Zimin: "U vseh pol'zovatelej uid i gid dolzhen byt' odinakovym i sovpadat' s uid/gid psevdo-pol'zovatelya "uucp", kotoryj takzhe dolzhen byt' obyazatel'no v sisteme! |to nuzhno i dlya pravil'noj raboty i dlya sek'yurnosti - (zabyl konkretno gde, no odin neradivyj admin daval vsem raznye uid, kak standartnym pol'zovatelyam i ego slomali po ftp) a naprimer v sluchae uucp-pol'zovatelya ego uid propisan v /etc/ftpusers kak tot, komu nel'zya lomit'sya po ftp".


    Sostavitel': Victor Sudakov, 2:5005/49@FidoNet
    Otzyvy i predlozheniya pros'ba prisylat' po adresu vas@vas.tsu.tomsk.su
    Bol'shoe spasibo vsem, kto pomog mne v sostavlenii etogo FAQ:
  • zss@gw.dic.ru (Sergey Zimin)
  • Igor Nikolaev (2:5030/266@fidonet)

    Last-modified: Thu, 29 Apr 1999 19:55:25 GMT
    Ocenite etot tekst: