[WikiDyd] [TitleIndex] [WordIndex

Wlaczenie serwera ftp za posrednictwem inetd Dokumentacja: man inetd inetd.conf ftp ftpd (z url-ami ;)

1. Sprawdzenie ze serwis nie dziala:

     ftp loclahost

2. Aktywacja serwisu w inet (tylko wersj IP4 bez IP6):

     # sed -i-OLD 's/^#ftp/ftp/' /etc/inetd.conf
     diff /etc/inetd.conf-OLD /etc/inetd.conf

3. Uruchomienie inetd

     # /etc/rc.d/inetd onestatus

     # /etc/rc.d/inetd onestart

     # /etc/rc.d/inetd onestatus

     pgrep -lf inetd

  % grep 'inetd_[ef]' /etc/{defaults/,}rc.conf
  inetd_enable="NO"               # Run the network daemon dispatcher
  (YES/NO).
  inetd_flags="-wW -C 60"         # Optional flags to inetd

4. Sprawdzenie ze ftp dziala:

     ftp loclahost

     vol2% ftp localhost

5. Uwagi

via3% # sed -i-OLD 's/^#ftp/ftp/' /etc/inetd.conf
via3% diff /etc/inetd.conf-OLD /etc/inetd.conf
9,10c9,10
< #ftp  stream  tcp     nowait  root    /usr/libexec/ftpd       ftpd -l
< #ftp  stream  tcp6    nowait  root    /usr/libexec/ftpd       ftpd -l
---
> > ftp   stream  tcp     nowait  root    /usr/libexec/ftpd       ftpd -l
> > ftp   stream  tcp6    nowait  root    /usr/libexec/ftpd       ftpd -l
via3% # /etc/rc.d/inetd onestatus
inetd is not running.
via3% # /etc/rc.d/inetd onestart 
Starting inetd.
via3% # /etc/rc.d/inetd onestatus
inetd is running as pid 3253.
via3% ftp localhost
Connected to localhost.
220 via3 FTP server (Version 6.00LS) ready.
Name (localhost:ato): ^Z
zsh: suspended  ftp localhost
via3% # lsof -c ftpd
lsof: WARNING: access /root/.lsof_via3: No such file or directory
lsof: WARNING: can't open /root/.lsof_via3: Read-only file system
COMMAND  PID USER   FD   TYPE       DEVICE SIZE/OFF    NODE NAME
ftpd    3262 root  cwd   VDIR 255,33554433     1024       2 /
ftpd    3262 root  rtd   VDIR 255,33554433     1024       2 /
ftpd    3262 root  txt   VREG 255,33554433    82808 1951282 /usr/libexec/ftpd
ftpd    3262 root  txt   VREG 255,33554433   170588 2848780 /libexec/ld-elf.so.1
ftpd    3262 root  txt   VREG 255,33554433    44164 1520153 /lib/libutil.so.6
ftpd    3262 root  txt   VREG 255,33554433    28672 1520123 /lib/libcrypt.so.3
ftpd    3262 root  txt   VREG 255,33554433    31948 1951122 /usr/lib/libopie.so.4
ftpd    3262 root  txt   VREG 255,33554433    58376 1520138 /lib/libmd.so.3
ftpd    3262 root  txt   VREG 255,33554433    98108 1520124 /lib/libm.so.4
ftpd    3262 root  txt   VREG 255,33554433    25484 1951244 /usr/lib/libpam.so.3
ftpd    3262 root  txt   VREG 255,33554433   969852 1520223 /lib/libc.so.7
ftpd    3262 root    0u  IPv4   0xc2f6c000      0t0     TCP localhost:ftp->localhost:61490 (ESTABLISHED)
ftpd    3262 root    1u  IPv4   0xc2f6c000      0t0     TCP localhost:ftp->localhost:61490 (ESTABLISHED)
ftpd    3262 root    2w  VCHR         0,25      0t0      25 /dev/null
ftpd    3262 root    3u  unix   0xc2ce5914      0t0         ->0xc2529914
via3% 

Dla telnet-a trzeba pamietac, ze jest standardowo zablokowany przez tcp-wrapers (man hosts.allow , cat /usr/src/contrib/tcp_wrappers/README) poniewaz haslo przesylane jest w sieci jawnie. Trzeba wiec "ukryc" hosts.allow np.:

   # mv /etc/hosts.allow /etc/hosts.allow-OLD

2015-09-23 06:44