Ocenite etot tekst:


Sistema peresylki fajlov po telefonu.

Esli  uucp  pravil'no  skonfigurirovano,  to  ego ispol'zovanie
vyglyadit primerno tak:

   uucp -r moj_fajl  'pulsar!fajl_tam'

pereshlet  moj_fajl  na  udalennuyu  mashinu  pulsar. Hotya, skoree
vsego ne  sdelaet,  iz-za  ogranichenij  na  prava  dostupa.  A,
vprochem, takaya komanda skoree vsego srabotaet:

   uucp -r moj_fajl  'pulsar!~'

cherez nekotoroe vremya etot fajl vy smozhete obnaruzhit' na mashine
pulsar v kataloge

    /usr/spool/uucppublic/

v etot katalog razresheno kopirovanie s udalennyh mashin, dlya ne-
go ispol'zuetsya special'noe oboznachenie: "~"

Pust' vas ne udivlyaet, chto v komande uucp  ispol'zovalis'  odi-
narnye  kavychki.  Oni  nuzhny, chtoby zaekranirovat' "!" i "~" ot
vashego komandnogo interpretatora ksh ili bash. Klyuch -r v koman-
de uucp nuzhen, chtoby NE ZASTAVLYATX nashu mashinu nemedlenno nachi-
nat' zvonit' na pulsar. Ona sama  pozvonit,  v  predusmotrennoe
dlya etogo vremya.

uucp podderzhivaetsya na dvuh urovnyah:
  1. Pol'zovatel'skij. |to komandy uucp - postanovka fajla
v ochered' na udalennuyu peresylku, i uux - postanovka
v ochered' na peresylku udalennoj komandy.

 2.  Sistemnyj.  Periodicheski,  avtomaticheski zapuskaetsya demon
uucico - (UUCP Copy in Copy out). On sozvanivaetsya s udalennymi
mashinami  po  telefonu.  Na  udalennoj mashine takzhe zapuskaetsya
"vstrechnyj" demon uucico. Nash demon "protalkivaet" na udalennuyu
mashinu  vse fajly, kotorye k etomu vremeni nakopilis' v ocheredi
na otpravku tuda. Posle etogo  on  "prinimaet"  fajly,  kotorye
prigotovila  dlya  nas  udalennaya  mashina (ih k nam protalkivaet
"vstrechnyj" demon uucico, a nash prinimaet). Posle  etogo  seans
uucico  zakanchivaetsya.  A  pol'zovateli obnaruzhivayut, chto u nih
voznikli novye fajly.

   Predpolagaetsya, chto sistemnye administratory na nashej  i  na
udalennoj  mashine ne zabyli pravil'no opisat' i prokonfiguriro-
vat' sistemu UUCP.



Posle etogo nasha mashina smozhet zvonit' na  udalennye  mashiny  i
posylat'/zabirat' ottuda fajly. Dlya etogo my dolzhny zadat':

1. Nashe sobstvennoe UUCP imya.
2. Imya(imena) udalennoj(yh) UUCP sistemy.
3. Telefonnyj nomer(a), po kotoromu nuzhno tuda zvonit'.
4. Login i parol', kotorye vydeleny tam dlya nashego uucp-account'a.
5. Port, k kotoromu podklyuchen nash modem.
6. Naborshchik - opisanie "AT" komand dlya upravleniya nashim modemom.

|ti dannye zadayutsya v neskol'kih konfiguracionnyh fajlah, koto-
rye dolzhny lezhat' v kataloge /etc/uucp/ (ili   /usr/lib/uucp/ ,
ili    /usr/lib/uucp/taylor_config  )  (ili   v   kakom  nibud'
drugom, sm. man uucp dlya bolee tochnoj informacii). |to fajly:

Config          #   zadaet imya nashej mashiny (i mnogoe drugoe) ;
Systems         #   opisyvaet udalennye uucp-sistemy: imya,  no-
                #   mer telefona, uucp-logname, uucp-passwd ;
Devices         #   porty, k kotorym podklyucheny modemy.
Dialers         #   opisyvaet  modemy-naborshchiki (sistemu AT-ko-
                #   mand).
(A v Linux oni nazyvayutsya: config, sys, port, dial)

Itak, predstavim  klassicheskij sluchaj. U vas odin Hayes-sovmes-
timyj  modem  V32/V42bis   na   14400  baud  (GVC,  ZyXEL,  US-
Robotics...), podklyuchennyj k posledovatel'nomu portu /dev/modem
(esli u vas  port nazyvaetsya /dev/contty03, vam nikto ne meshaet
sdelat' simvolicheskij  link  ln  -s /dev/contty03 /dev/modem ne
tak li ?). Imya vashego uzla fedfuru.

VNIMANIE.  Na bol'shinstve Unix-ov vydeleny razdel'nye special'-
nye fajly dlya odnogo i togo-zhe porta: terminal'naya  liniya  (dlya
podklyucheniya  terminala  ili  modema, NA kotoryj budut zvonit' -
ispol'zuetsya dlya getty ili ttymon), i liniya s modemnym upravle-
niem,  na  vyhod  -  naprimer, chtob zvonit' NARUZHU modemom. |ti
special'nye fajly i nazyvayutsya po raznomu, naprimer:

SunOS:   /dev/ttyy01   IN, /dev/ttyz01  OUT
Linux:   /dev/ttyS1    IN, /dev/cua1    OUT
ISC:     /dev/ttyFD01  IN, /dev/ttyFM01 OUT
SVR4/88: /dev/contty00 IN, /dev/??????? OUT

###sleduyushchij abzac napisan "melkim shriftom"(mozhno ne chitat')###
Na samom dele vse ne sovsem tak. Citiruyu Linux-Serial-HOWTO:
> There has been some discussion  on  the  merits of /dev/mouse
> and /dev/modem. I strongly discourage the use of these links.
> In particular,  if you are planning  on using your  modem for
> dialin you will run into problems because the lock files will
> not work correctly if  you  use /dev/modem. Also, Taylor UUCP
  does not support symlinks either. Odnako uugetty pozvolyaet
  korrektno otrabatyvat' etu situaciyu. Sm. parametr ALTLOCK v
  /etc/defaults/getty fajle.
################_konec_"melkogo shrifta"_#######################

  Vam  nado podklyuchit'sya k dvum uucp-uzlam:
1: Uzel Relkom, imya uzla kiae, telefony:  9469984,  9469994. Vy
   zaregistrirovany tam pod imenem/parolem uufedurp/ABCd8
2: Vashe  moskovskoe  otdelenie,  imya uzla fedfond, telefon 095-
   125-7623.  Vy  zaregistrirovany   tam   pod   imenem/parolem
   uufedurp/KLmn10

V kataloge /etc/uucp redaktiruem fajly Systems, Devices, Dialers

Systems: ------- Udalennye mashiny -----------------------------
kiae Any modem1 19200 946-9984 "" \n\r\d\r\d\r ogin:-BREAK-ogin:
                                   uufedurp ssword: ABCd8
fedfond Any modem1 19200 8w095-125-7623 "" \n\r ogin:-BREAK-ogin:
                                   uufedurp ssword: KLmn10

Devices: --------------- Opisanie portov ----------------------
modem1 contty03 - 19200 gvc1440

Dialers: --------------- Komandy modemov ----------------------
gvc1440 =,-, "" \M\dATZ\r\c OK\r \EATDP\T\r\c CONNECT \m\c

---------------- |to vse --------------------------------------

###sleduyushchij abzac napisan "melkim shriftom"(mozhno ne chitat')###
A dal'she idet opisanie Taylor-uucp. Problema v tom, chto v stan-
dartnoj postavke SVR4/88 _net_ Taylor-uucp, a  est' tol'ko t.n.
HoneyDanBer-uucp,  on  zhe  BNU  (Basic  Networking  Utilities).
Taylor novee i gibche, k tomu zhe podderzhivaet dva formata konfi-
guracionnyh fajlov  -  tradicionnyj  (Config, Systems, Devices,
Dialers, ...)  i svoj (config, sys, port, dial, ...). Est' kon-
verter tuda-obratno.  V  Linuxe  Taylor-uucp skompilirovan tak,
chtoby      snachala       iskat'      Taylor-konfiguraciyu      v
/usr/lib/uucp/taylor_config/,  esli  tam nichego  net  -  iskat'
HDB-konfiguraciyu  v   /usr/lib/uucp/hdb_config/.  IMHO  glavnyj
iz®yan HDB - nevozmozhnost' ukazyvat' al'ternativnye nomera tele-
fonov.
################_konec_"melkogo shrifta"_#######################

###sleduyushchij abzac napisan "melkim shriftom"###
Esli vy ispol'zuete ne ustarevshij BNU-uucp, a Taylor-uucp 1.05:
V kataloge /usr/lib/uucp/taylor_config sozdaem fajly config,
sys, port, dial sleduyushchego soderzhaniya:
/* Primechanie: v distributivah RedHat Linux konfiguracionnye fajly
uucp dolzhny lezhat' v /etc/uucp/ */

config: -------------------------------------------------------
uuname     fedfuru        #  Nashe sobstvennoe imya

sys: ------- Udalennye mashiny ---------------------------------
system kiae          # Uzel Relkom ############################
myname fedfuru
time Any
port  modem         # Imya opisaniya porta v fajle port
speed 38400
chat  ogin:-BREAK-ogin: uufedurp ssword: ABCd8
phone 946-9984
alternate            # Vtoroj telefonnyj nomer.
phone  946-9994

system fedfond       # Moskovskoe otdelenie ##################
time Any
myname   fedfuru
port  modem         # Imya opisaniya porta v fajle port
speed 38400
chat  ogin:-BREAK-ogin: uufedurp ssword: KLmn10
phone 8w095-125-7623

port: --------------- Opisanie portov ------------------------
port    modem       # Oboznachenie porta  iz fajla   sys
type    modem
device  /dev/modem
speed   38400
dialer  gvc1440      # Imya naborshchika-modema v fajle  dial

dial: --------------- Komandy modemov ------------------------
dialer     gvc1440   # Oboznachenie naborshchika iz fajla  port

# Stroka inicializacii modema.
# Vmesto \T budet podstavlen telefonnyj nomer
chat       "" ATZ OK ATH0E0Q0 OK ATDP\T CONNECT
# ATZ - zagruzit' profile 0
# ATH0 - povesit' trubku
# ATE0 - no echo
# ATQ0 - vyvodit' kod vozvrata

chat-fail  BUSY                # Vosprinimat' kak oshibku nabora
chat-fail  ERROR
chat-fail  NO\sCARRIER
chat-fail  NO\sDIALTONE
---------------------------------------------------------------
################_konec_"melkogo shrifta"_#######################

Vse.  Klientskaya  chast'  UUCP  skonfigurirovana.  Teper', chtoby
"protolknut'"   poslannye   fajly,   dostatochno    periodicheski
vypolnyat' komandy:

uucico -s kiae
uucico -s fedfond

A  eshche  luchshe,  dobavit'  eti  komandy  v  crontab,  chtoby  oni  vypolnyalis'
avtomaticheski, po neskol'ko raz v sutki.



Vse vysheperechislennye nastrojki mozhno sdelat', ispol'zuya utili-
tu   sistemnogo   administratora  sysadm.  Nado  vojti  v  menyu
network_services / basic_network



Itak, my uzhe mozhem zvonit' na chuzhie mashiny, i peresylat' na nih
fajly. Teper' nuzhno sdelat', chtoby chuzhie mashiny (klienty) mogli
zvonit' nam. Dlya etogo nuzhno:

1: Imet'  opisanie zvonyashchej nam uucp-sistemy v fajle Systems  -
   dlya klienta takoe zhe, kak i dlya servera.
2: Proverit' prava dostupa dlya klienta v fajle Permitions
2: Zavesti dlya nego special'nyj uucp-login
3: Ubedit'sya, chto modem stoit v "Auto-answer" rezhime, i na port
   /dev/modem  zapushchena programma getty (ili ttymon), pozvolyayu-
   shchaya loginit'sya po telefonu na port /dev/modem

1.  Opisanie  dobavlyaetsya  v  fajl  Systems,  (nomer telefona i
    nazvanie   porta   ne   obyazatel'ny),  esli  my  sami    ne
    sobiraemsya tuda zvonit', no ya by posovetoval ih vpisat', dlya
    edinoobraziya.

2. V fajle /etc/passwd zavesti strochku vida:

uupetrov:x:1002:14:UU Petrov:/var/spool/uucp:/usr/lib/uucp/uucico

   vypolnit' komandy:
pwconv
passwd uupetrov

3. Lyuboj terminal'noj programmoj "vojti" v modemnyj port i  vy-
   polnit' komandy

atz0         # Zagruzit' pol'zovatel'skij profile 0
ats0=1       # Registr0=1 - snimat' trubku posle 1-go zvonka
at&w0        # Sohranit' tekushchij setup v profile 0
at&y0        # CHtoby pri vklyuchenii pitaniya zagruzhalsya profajl 0

# at&f       # zagruzit' zavodskie ustanovki, esli vy zaputalis'
             # s profajlami, mozhno sdelat' modemu "reset"

Vvidu   otsutstviya   kommunikacionnyh   programm   v  SVR4  (za
isklyucheniem sumasshedshego "cu"), ispol'zujte "echo".

     echo atz0   > /dev/modem
     echo ats0=0 > /dev/modem
     echo at&w0  > /dev/modem         # i tak dalee

A eshche luchshe gold, tam est' rezhim pryamoj svyazi s lyubym portom.

4. V fajle /etc/inittab imet' strochku vida:

c3:234:respawn:/usr/lib/saf/ttymon -g -d /dev/modem   -l contty




/usr/bin/uucp     - pereslat' fajly s/na udalennuyu uucp-sistemu
/usr/bin/uux      - vypolnit' komandu na udalennoj uucp-sisteme
/usr/bin/uustat   - statistika po vypolnennym peresylkam

/usr/lib/uucp/uu* - sistemnye utility UUCP

/etc/uucp/              - katalog  konfiguracionnyh fajlov UUCP

  /usr/lib/uucp/taylor_config    - konfiguraciya UUCP v Linux
  /usr/lib/uucp/                 - konfiguraciya UUCP v drugih
                                   sistemah

/var/spool/uucppublic     - katalog v kotoryj mozhno  peresylat'
                            fajly s udalennyh mashin

/usr/spool/mqueue         - ocheredi otpravlyaemoj elektronnoj pochty
   /usr/ucblib/mqueue     - ili zdes' eta ochered' ?
/var/spool/uucp/"mashina"  - ochered' fajlov na otpravku na "mashinu"
/var/spool/uucp/.Log      - statistika o rabote uucp



Esli u vas samyj prostejshij sluchaj: vsya vasha pochta prohodit che-
rez odin "znayushchij" host, s kotorym vy soedineny po uucp, to na-
do v fajle /etc/sendmail.cf imet' takuyu stroku:

. . .
# "Smart" relay host (may be null)
DSuucp-dom:kiae
. . .

V  etom  sluchae  vsya  vasha  vneshnyaya pochta (t.e. otpravlyaemaya za
predely vashej lokal'noj seti) budet perepravlyat'sya po  uucp  na
uucp-uzel  "kiae"  i  dal'nejshej  ee  dostavkoj  budet ozabochen
imenno kiae. Predpolagaetsya, chto on uspeshno  spravitsya  s  etoj
zadachej.

A  eshche  chtoby  bylo  opisanie  uucp-dom  (nizhe v tom zhe fajle).
Kstati, chtoby vseh okonchatel'no zaputat', sendmail.cf na  Moto­
role lezhit vovse ne v /etc/, a v /usr/ucblib/.

Esli u vas kakoj-libo drugoj sluchaj - to eto -  tyazhelyj sluchaj.
Derzajte, uspehov vam!

# I nado sdelat', chtob sendmail ne otrezal 8-j bit u posylaemoj pochty
# Esli sendmail8.x.x, to v sendmail.cf:
# strip message body to 7 bits on input?
O7False


# A eshche byvaet, chto sendmail ne znaet, kak pravil'no nazyvaetsya
# nasha mashina. Togda my pishem chto-to v takom stile:

Cwlocalhost feduru.urup.ru feduru.mss.ru



Dlya nachala proverim, pravil'no li podsoedinen modem.
Zapuskaem programmu cu - emulyator terminala.

   cu -l /dev/modem    # Ili kak tam u vas etot port nazyvaetsya

Posle etogo vy  pereklyuchites' na rabotu so svoim modemnym  por-
tom.  Vse, chto vy  budete nabirat' s klaviatury, budet perenap-
ravlyat'sya v port /dev/modem , vse, chto "prihodit" s  etogo por-
ta, budet  risovat'sya  na  vashem  terminale. Poprobujte modemom
nabrat' telefonnyj nomer

   atdp100

Prover'te, pravil'no  li skonfigurirovan "port" modema i opisa-
nie sistemy v fajle Systems.

   cu pulsar

Prover'te prava dostupa k fajlam /dev/modem, /dev/contty*. Dol-
zhno byt' (???):

 crw-rw----   1 root     uucp       ...         /dev/contty0
 crw-rw----   1 root     uucp       ...         /dev/modem

Zapustite uucico  s  maksimal'nym urovnem vydachi otladochnoj in-
formacii. Zapuskat' nado iz pod pol'zovatelya uucp

   /usr/lib/uucp/uucico -r1 -x9 -f -s pulsar
   /usr/lib/uucp/uucico -x all -f -s kiae

A zatem posmotrite na  soderzhanie  fajlov so statistikoj uucp v
kataloge /var/spool/uucp :

   .Admin/audit.local
   .Log/
   .Status/
   ERRLOG
   LOGFILE
   SYSLOG

Naprimer, takoj komandoj

   tail -f /var/uucp/.Admin/audit.local &
   tail -f /var/uucp/.Log/uucico/kiae



###sleduyushchij abzac napisan "melkim shriftom"(mozhno ne chitat')####
Dmitry Mayorov Compulsory Health Insurance Fund
Phone: +7 (812) 112-3517                  St. Petersburg, Russia
> Naveshal fil'trov na sendmail, rmail,
> a vot eto neponyatno. Ili oni nauchilis' vse iz koi8 v iso pere-
> vorachivat' na letu ?

Net, konechno,  potrebovalos'  lechit'.  Delo sil'no uprostilo to
obstoyatel'stvo, chto  vnutri  seti vezde ISO. Perekodirovat' po-
etomu mne nado tol'ko to, chto idet cherez UUCP, to  bish' naruzhu.
Dlya etogo prishlos':

1. Popravit' sendmail.cf:

# RelCom UUCP - with ISO 8859-5 to KOI-8 translation
Muucp-koi, P=/usr/local/bin/_uux, F=mDFMhu, S=52/31, R=21, M=100000,
                   ^^^^^^^^^^^^^^^^^^^ moj, sm. nizhe
           A=_uux - -r -a$f -gC $h!rmail ($u)

2. Sdelat' /usr/local/bin/_uux iz treh strok:
#!/bin/sh
PATH=:/usr/bin:/usr/local/bin:/usr/ucb:/bin:
/usr/local/bin/iso-koi | /usr/bin/uux $*

(iso-koi - ponyatno kakoj fil'tr)

|to vse, na samom dele, ves'ma gryaznyj hack - vryad li stoit ego
vklyuchat' v uchebnik. Ono, konechno,  rabotaet,  no  vot  nado  po
krajnej  mere eshche i pravil'nyj kod vozvrata kak-to obespechit' -
s proverkoj oshibok i prochimi fenechkami.

     CHtoby prinimaemaya pochta iz KOI prevrashchalas' v ISO, dostatochno:

1. Pereimenovat' rmail v /usr/local/bin/__rmail;
2. Sdelat' svoj rmail, tozhe iz treh strochek:

#!/bin/sh
PATH=:/usr/bin:/usr/local/bin:/usr/ucb:/bin:
/usr/local/bin/koi-iso | /usr/local/bin/__rmail $*

Vysheukazannuyu ekzekuciyu  nado proizvodit' imenno nad rmail, po-
tomu chto rbmail proveryaet kontrol'nye summy.

A vot rbmail v SVR4/88 sovsem net. Nado iskat' ishodniki, sobi-
rat'... A RelCom (po krajnej mere  moj  provajder)  imenno  ego
pol'zuet. |to  tret'ya  prichina  (posle otsutstviya Taylor-uucp i
udobnogo Mail-user agenta),  po kotoroj  ya  ne  stal  podnimat'
uucp/e-mail na Motorole.

--
Dmitry Mayorov Compulsory Health Insurance Fund
Phone: +7 (812) 112-3517                 St. Petersburg, Russia
        -- Konec citaty --
################_konec_"melkogo shrifta"_#######################

    Solaris: nastrojka uucp po direct line

V fajle Systems na Solyarke udalennaya mashina opisyvaetsya tak: ranisi Any dirt06 9600 unused "" P_ZERO "" \n\c ogin:-\n\c-ogin: uuintra\n\c ssword: parolf9f10\n\c "" P_ZERO Po sravneniyu s normal'nym tailor-uucp prestarelyj solyarkin po pryamomu kabelyu vykinul neskol'ko fortelej: Ne zahotel idti naruzhu s 38400, prishlos' stavit' 9600 Posylaemyj ^M v konce kazhdoj stroki chat-a prinimayushchij Linux ponimat' otkazalsya, prishlos' delat' v konce \n\c Rabotat' stal tol'ko s nasil'stvenno vzvedennym P_ZERO - "no parity" - bez etogo na prieme vmesto latinicy poluchalas' 8-bitnaya rusica. V uucp-ovyj crontab stavim raz v 5 minut vyzov uucico 0,5,10,15,18,20,25,30,35,40,45,50,55 * * * * (\ /usr/lib/uucp/uucico -r1 -f -s ranisi ; sleep 30 ; \ /usr/lib/sendmail -q ) > /dev/null 2>&1 U solyarnogo uucico ne okazalos' klyucha "force" redial (-f - sovsem ne tot force, kotorogo hotelos' mne)

    CHtob zastavit' uucico hodit' na telnetovskij port

> v logah nablyudaetsya otkrovennyj musor: \177}\030\177} \177}#\177} port type pipe port command /bin/telnet -8E hostname

    Secure uucp po tcp

Variant 1. port type tcp with ssh-port forwarding NA SERVERE: konfigurite uucp-tcp-server s localhost /etc/inetd.conf : uucp stream tcp nowait uucp /usr/sbin/tcpd /usr/sbin/uucico -l /etc/hosts.allow : uucico: 127.0.0.1 # uucico zhelaet ego chitat', a rabotaet on s uid uucp - prihoditsya dat' read chmod og+r /etc/hosts.allow /etc/uucp/passwd : propisatx uu-login, parol' _neshifrovannyj_ uuyourlogin yourpasswd NA KLIENTE: konnekt budete delat' na localhost, a ssh delaet ego probros /etc/inetd.conf : uucp stream tcp nowait uucp /usr/sbin/tcpd /usr/sbin/uucico -l /etc/hosts.allow : uucico: 127.0.0.1 /etc/uucp/port : opisat' port tcp-connect port tcp-connect type tcp service 540 /etc/uucp/sys : dobavit' tip porta . . . port tcp-connect address 127.0.0.1 chat ogin: \L ssword: \P alternate . . . "Pered upotrebleniem" zapuskaem iz pod root ssh s aktivizirovannym forward ssh1 -C -L 540:127.0.0.1:540 193.232.173.6

Last-modified: Mon, 03 Apr 2000 08:38:25 GMT
Ocenite etot tekst: