The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]

Поиск:  Каталог документации

Next Previous Contents

4. Setting up the config files

I recommend you start by installing the attached known-good config. files included in the document.

4.1 Installing config. files

Put these file in their "standard" location: /etc/uucp on recent linux distributions or /usr/lib/uucp on older ones.

Then make sure that the permissions of the files are

(guylhem@barberouge:uucp)$ ls -l
total 11
-rw-r--r--   1 uucp     uucp          501 Jan 23 11:33 Poll
-rw-r-----   1 uucp     uucp          589 Jan 23 11:34 call
-rw-r-----   1 uucp     uucp         1184 Jan 23 12:06 config
-rw-r-----   1 uucp     uucp          476 Jan 23 12:31 crontab
-rw-r-----   1 uucp     uucp         1256 Jan 23 11:47 dial
-rw-r-----   1 uucp     uucp          486 Jan 23 11:48 passwd
-rw-r-----   1 uucp     uucp          810 Jan 23 11:55 port
-rw-r--r--   1 uucp     uucp         1690 Jan 23 12:04 sys
(guylhem@barberouge:uucp)$

To change file owner, as root, type:

(root@barberouge:uucp)$ chown uucp.uucp *

Then you must change file permissions; as root once again, type:

(root@barberouge:uucp)# chmod 640 *
(root@barberouge:uucp)# chmod +r Poll sys

4.2 "Poll" file

This file is used to set polling timetables for any system.

schedule polux 01
poll     polux 01

My machine calls polux at 01:00, that's all!

You can add more line if you must call many other machines, but don't forget to put the 2 lines (schedule & poll) for each.

4.3 "call" file

It contains your login/password for each system you poll:

polux uudan password

My machine uses "uudan" login & "password" password :-) when it polls "polux".

As for Poll, adapt this to your situation.

4.4 "config" file

nodename barberouge                     # The UUCP name of this system

spool /var/spool/uucp                   # The UUCP spool directory
pubdir /var/spool/uucppublic            # The UUCP public directory
logfile /var/log/uucp/log               # The UUCP log file
statfile /var/log/uucp/stats            # The UUCP statistics file
debugfile /var/log/uucp/debug           # The UUCP debugging file

#sysfile        /etc/uucp/sys           # Default "sys"
#portfile       /etc/uucp/port          # Default "port"
#dialfile       /etc/uucp/dial          # Default "dial"
#dialcodefile   /etc/uucp/dialcode      # Default "dialcode"
#callfile       /etc/uucp/call          # Default "call"
#passwdfile     /etc/uucp/passwd        # Default "passwd"

# No commands may be executed by unknowns (empty list of permitted commands)
# Upload is authorized in /var/spool/uucp
unknown commands
unknown pubdir /var/spool/uucp
unknown remote-send ~ !~/upload
unknown remote-receive ~/upload

Here just replace "barberouge" by your system name ; run "hostname" if you can't remind it.

4.5 "crontab" file

# Every day just before morning generate reports.
#
0 7 * * *     /usr/lib/uucp/uudemon.day root
#
# Every hour start the uudemon.hr. To actually poll a remote system,
# enter its name in /etc/uucp/Poll. You are encouraged to change the "8".
#
8 * * * *      /usr/lib/uucp/uudemon.hr

Just run "crontab -u uucp /etc/uucp/crontab" to add it to the others crontabs.

4.6 "dial" file

# 1) expect nothing (i.e., continue with step 2)
# 2) send "ATZ", then a carriage return, then sleep for 1 to 2 seconds.
# The \c means to not send a final carriage return.
# 3) wait until the modem echoes "OK", then do the the same for "ATX4" & "OK"
# 4) send "ATDT", then the telephone number (after translating any dialcodes).
# 5) wait until the modem echoes "CONNECT"
# 6) if we get "BUSY", "NO CARRIER" ... during the chat script we abort dialing
# 7) when the call is over, we make sure we hangup the modem


dialer hayes
chat "" ATZ\r\d\c OK\r \dATX4\r\d\c OK\r ATDT\D CONNECT
chat-fail RING
chat-fail NO\sCARRIER
chat-fail ERROR
chat-fail NO\sDIALTONE
chat-fail BUSY
chat-fail NO\sANSWER
chat-fail VOICE
complete \d\d+++\d\dATH\r\c
abort \d\d+++\d\dATH\r\c

# You can also add other dialers: inetd, nullmodem ...
#dialer nullmodem
#complete \d\dexit\r\c
#abort \d\dexit\r\c

Syntax is complicated ... you'd rather not touch anything here but "ATZ" & "ATX4" which are my modem init string.

4.7 "passwd" file

#uuguest                guestpassword

If you allow uucp dialin, just add system/passwords in this file.

It's *that* simple.

But it's recommended for security reasons to make sure each have a separate account & home directory so you can track things.

4.8 "port" file

# Description for the modem entry
# Debianers, make SURE this device is root:dialout, mode 0660 (crw-rw---)

port ACU
type modem
device /dev/ttyS0
dialer hayes
speed 57600
# hardflow n


# Description for the TCP port - pretty trivial. DON'T DELETE.
# Change service number if non standard, cf /etc/services

port TCP
type tcp
#service 540


# Description for the nullmodem entry
# (ttyS1 means COM2)

port nullmodem
type direct
device /dev/ttyS1
dialer nullmodem
speed 115200

You shouldn't change anything here ... except your modem port.

On recent distributions with mgetty, it's /dev/ttySN while on older distributions it's /dev/cuaN, where N is you serial port:

N starts at 0 & ttyS(N) means COM(N+1), for example, my null-modem is on ttyS1 (COM2) while my modem is on ttyS0 (COM1).

Most of recent modems support hardware flow control, if your doesn't, just uncomment the line "# hardflow n".

4.9 "sys" file

# First some defaults. These are for ALL other entries (unless overridden).
#
protocol gvG
protocol-parameter G packet-size 1024
# protocol-parameter G window 7
protocol-parameter G short-packets

#
# Our remote uucp connection.
#
system polux
call-login *
call-password *
local-send /
local-receive /var/spool/uucppublic
remote-send /
remote-receive /var/spool/uucppublic
time any
phone 0111111110
port ACU
chat "" \r\c ogin:-BREAK-ogin:-BREAK- \L word: \P
#chat "" \d\d\r\c ogin: \d\L word: \P

# This is an alternate - it means that if a connection using the above
# "system polux" fails it falls through to this entry.
# Only useful if your service provider has more then one phone number for UUCP.
#
#alternate polux-2
#alias polux-2
#phone 0222222220

# Here's another alternate - we poll the system over TCP/IP.
# This is useful if we have a PPP connection to our provider.
# The first two entries will fail because the modem is busy & we will poll
# over TCP/IP.
#
#alternate polux-tcp
#alias polux-tcp
#time any
#address uucp.polux
#port TCP
#protocol t

#
# Last example - a system that we poll over TCP/IP.
#
#system horizon
#call-login *
#call-password *
#time any
#chat "" \d\d\r\c ogin: \d\L word: \P
#address uucp.horizon.nl
#port TCP
#protocol t

Here, you must change "polux" by the name of the system you poll & "0111111110" by its phone number.

"polux-2", "polux-tcp" & "horizon" are just examples of user specific needs ; if the system you poll has more than one line, define it as "itsname-2" ; if you call it by PPP sometimes, just define "itsname-tcp" also.

It's useful when chat script fail (busy ...)

4.10 Now let's test all this

First run:

(root@barberouge:uucp)# su uucp
(uucp@barberouge:uucp)# /usr/lib/uucp/uuchk
Local node name barberouge
Spool directory /var/spool/uucp
Public directory /var/spool/uucppublic
Lock directory /var/lock
Log file /var/log/uucp/log
Statistics file /var/log/uucp/stats
Debug file /var/log/uucp/debug
Global debugging level
uucico -l will strip login names and passwords
uucico will strip UUCP protocol commands
Start uuxqt once per uucico invocation

System: polux
 When called using any login name
 Call out using port ACU
 The possible ports are:
  Port name ACU
   Port type modem
   Device /dev/ttyS0
   Speed 57600
   Carrier available
   Hardware flow control available
   Dialer hayes
    Chat script "" ATZ\r\d\c OK\r \dATX4\r\d\c OK\r ATDT\D CONNECT
    Chat script timeout 60
    Chat failure strings RING NO\sCARRIER ERROR NO\sDIALTONE BUSY NO\sANSWER VOICE
    Chat script incoming bytes stripped to seven bits
    Wait for dialtone ,
    Pause while dialing ,
    Carrier available
    Wait 60 seconds for carrier
    When complete chat script "" \d\d+++\d\dATH\r\c
    When complete chat script timeout 60
    When complete chat script incoming bytes stripped to seven bits
    When aborting chat script "" \d\d+++\d\dATH\r\c
    When aborting chat script timeout 60
    When aborting chat script incoming bytes stripped to seven bits
 Phone number 0111111110
 Chat script "" \r\c ogin:-BREAK-ogin:-BREAK- \L word: \P
 Chat script timeout 10
 Chat script incoming bytes stripped to seven bits
 Login name uudan
 Password your_password_here
 At any time may call if any work
 May retry the call up to 26 times
 May make local requests when calling
 May make local requests when called
 May send by local request: /
 May send by remote request: /
 May accept by local request: /var/spool/uucppublic
 May receive by remote request: /var/spool/uucppublic
 May execute /usr/bin/uucp /usr/bin/rmail /usr/bin/rnews
 Execution path /bin /usr/bin /usr/local/bin /usr/sbin
 Will leave 50000 bytes available
 Public directory is /var/spool/uucppublic
 Will use protocols gvG
 For protocol G will use the following parameters
  packet-size 1024
  short-packets

to check if all the informations you've set are correct.

Warning: your mileage may vary ; different distributions use different paths, regardless Linux FSSTD!

If everything is correct, run:

        /usr/sbin/uucico -r 1 -x 9 -s remote_system_name

The -x 9 will have maximum debugging information written to the /var/log/uucp/debug file for help in initial setup.

I normally run -x 4 here since that level logs details that help me with login problems. Obviously, this text contains clear informations from your systems file (account/password) so protect it against world-read.

4.11 Additional informations

>From Pierre.Beyssac at emeraude.syseca.fr

Taylor has more logging levels. Use -x all to get the highest level possible.

Also, do a "tail -f /var/log/uucp/debug" while debugging to watch things happen on the fly.


Next Previous Contents


Партнёры:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
Хостинг:

Закладки на сайте
Проследить за страницей
Created 1996-2024 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру