X-Authentication-Warning: central.caverock.co.nz: viking set sender to flying-brick.caverock.net.nz!viking using -f Date: Thu, 4 Feb 1999 10:11:04 +1300 (NZDT) From: Eric Gillespie To: opendos AT delorie DOT com Subject: Re: ftp server for dos.... In-Reply-To: <199901290440.XAA00143@smtp.cisnet.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: opendos AT delorie DOT com On Thu, 28 Jan 1999, Glenn McCorkle wrote: : Does anyone know if there is an FTP 'server' for DOS. :I'de like to setup my old 486 as a server but I don't have the time :right now to put Linux on it. Yep. NCSA Telnet is capable of doing such a job. You'll have to read the documentation of course, but being a DR-DOS man, you'll probably be au fait with that. I'm using the 2.3.08 version - pity it doesn't come with more documentation, but I'll stick on what's applicable. People with Blind readers please note this will end up being a long file, and I'll finish in about another twenty lines. 1. You need to enable ftp access in the config.tel file, 2. Create a passwd file, (an example is pasted below) 2a Usually they like to have this file created with their program called telpass.exe, so humour them ... otherwise follow the format below very carefully. 3. Connect to the other end (using ppp, preferably) 4. Run telbin WITHOUT any parameters on the commandline (this is so it doesn't try to open a telnet session to anywhere but just sits in server mode) 5. Log in from the other machine (using ftp, ncftp or one of the cousins) 6. Transfer files to your hearts content. I use this system myself for transferring files between my Linux box and my DOS box. I use it in combo with a ported ppp driver called DOSpppd, which fortunately can be used either with a packet driver (such as from the crynwr project) or with a serial port to provide packet services itself. So that's another solution for the pot. Included information for telnet configuration...shortened to save some space == config.tel == # # Example host file for Telnet 2.3 # Distributed with 2.3.07 # The form is keyword=value for each parameter. # The first set of parameters refer to the whole program's defaults. # These parameter values can be in any order. # Following this are the individual machine specs. # If the first machine is name "default", then it contains default # values for the rest of the machines. # myip=192.168.2.2 # Required: your IP number # legal values are: # a number of the form: x.x.x.x # RARP # BOOTP #myip=127.0.0.1 # example IP specified in number form #myip=RARP # receive my IP number from a RARP server #myip=BOOTP # receive my IP number from a BOOTP server netmask=255.255.255.0 # subnetting mask # Default is 0.0.0.0 # Pick a hardware interface: packet driver, ISA board, or EISA board # This is the packet driver interface hardware=packet # network adapter board (packet driver interface) interrupt=0x60 # IRQ which adapter is set to ioaddr=7 # software interrupt vector driver is using [...bits cut out relating to hardware support...] #cursortop=2 # option to set the top of the cursor block # measured in scanlines from the top of the # character block # Default is -1 (don't modify the existing setting) #cursorbottom=7 # option to set the bottom of the cursor block # measured in scanlines from the top of the # character block # Default is -1 (don't modify the existing setting) broadcast=192.168.2.255 # broadcast IP number # Default is 255.255.255.255 windowgoaway=yes # whether windows go away when closed # Default is no autoscroll=no # whether to autoscroll when at the top of the # screen in scrollback # Default is yes #clock=off # whether the clock is displayed or not # Default is on #myname=me.ncsa.uiuc.edu # used in LPR to notify the LPR server # who is printing # Defaults to none termtype="vt100" # the type of terminal emulation to perform # currently only vt100 is supported # Default is vt100 #outputfile="outmap.tel" # path name of the output mapping file # Defaults to none keyfile="g:\internet\keymap.tel" # path name of your keyboard re-mapping file # Defaults to no mapping (do not omit) beep=yes # display musical note in session status # on the status line when a ascii 7 is received # in that session # Defaults to no services="g:\internet\services.tel" # path to the services file for displaying # network information # Defaults to none tek=no # enable tektronix graphics # Default is on video=cga # type of video screen # Legal values for video are: # cga,ega,pga,no9,hercules,ega43,vga50 # Default is ega bios=no # don't use slow BIOS screen access # bios=yes to reduce flicker on cga # bios=yes for TopView or Windows # Default is no rcp=yes # do you want rcp enabled? # Default is no # This line here is the one you want to enable - you will also # have to create a file as per specs in ftpnew.txt, added below ftp=yes # do you want ftp enabled? # Default is no ftpwrt=yes # if ftp is enabled, should any writes be allowed? # Default is yes # (Denial on user basis using password file) passfile="g:\internet\passwd" # Full Pathname of file with FTP passwords. # Default is none. # If ftp is allowed, use Telpass.exe to create # a password file. domainretry=3 # number of domain lookup retries # Default is 3 domain="flying-brick.caverock.net.nz" # default domain for hostname lookup # Default is none domaintime=4 # timeout in seconds for a domain lookup # Defaults to 4 concolor=020170 # Set the console colors # Default is 070170 (white on black) capfile="g:\internet\capfile.tel" # default name for capture file # Default is none arptime=8 # arp timeout in seconds # affects machines on your local network # Defaults to 8 # # Following are individual machine specifications # Gateways are used in order that they appear in the file # Nameservers rotate, #1, #2, #3, #1, #2 when a request fails # # The machine named "default" contains the fields which are automatically # filled in for later hosts # name=default # Session name, "default" is a reserved name # Not a real machine, default parameters only #host=sri-nic.arpa # Actual host name of machine, not session name # Required #hostip=10.0.0.51 # IP address of host, example is for SRI-NIC # Required #gateway=1 # This machine is a gateway for me # Default is no (0) #nameserver=1 # This machine has a DOMAIN name server for me # Default is no (0) scrollback=400 # number of lines of scrollback per session # Default is (0) #clearsave=on # whether to save cleared line in scrollback # Default is on # color codes for a specific session: # black, blue, green, cyan, red, magenta, yellow, white # BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, YELLOW, WHITE # # NOTE: when the highlighted colors are used for a background color, # they produce blinking text. nfcolor=white # vt100 normal foreground color # Default is green nbcolor=black # vt100 normal background color # Default is black bfcolor=red # vt100 blink foreground color # Default is black bbcolor=blue # vt100 blink background color # Default is green rfcolor=black # vt100 reverse foreground color # Default is blue rbcolor=white # vt100 reverse background color # Default is black ufcolor=red # vt100 underline foreground color # Default is blue ubcolor=cyan # vt100 underline background color # Default is black erase=backspace # use delete code or backspace code for <- key? # legal values are "delete" and "backspace" # Default is "backspace" vtwrap=yes # should VT100 be in wrap mode or not? # Default is no #vtwidth=80 # width of the vt100 screen # legal values are 80 and 132 # Default is 80 (132 may not work correctly) #crmap=crlf # crmap by default is "crlf" other options: # "cr", "lf", "crnul", and "4.3BSDCRNUL" # the last two both do the same thing. #outputmap=yes # Whether to use the output mapping for this # machine. (may need to change crmap) # Legal values are: "yes" or "no" # Default is no #duplex=half # modifier for non-echo mode, forces send # legal value are "full" and "half" # Default is full duplex #font=Monaco # font for the window text (Unsupported) # Default is Monaco #fsize=9 # fontsize for the window text (Unsupported) # Default is 9 #port=23 # value of the port to telnet to # Default is 23 #ftpoptions="-n" # modifier for the 'ftp back to PC' string # The string is sent as: # "ftp # Default is none #consoledebug=0 # Debug information level to display on colsole # The following entries affect the tuning of TCP connections to this host. # They should be set by the network administrator who is familiar with # the requirements of your specific network. contime=20 # timeout in seconds to try connection # before returning error to user # Default is (20) retrans=2 # time in seconds to wait before retransmit # Default is (5) mtu=512 # maximum transmit unit in bytes. # outgoing packet size, MAX=1024 # Default is (512) maxseg=512 # largest segment we can receive # whatever the hardware can take, MAX=2048 # Default is (1024) rwin=1024 # most bytes we can receive without ACK # =TCP window size, MAX=4096 # larger isn't always better # Default is (1024) # # Below this line, most of the communication parameters are obtained # from the "default" host entry. # Machine names, IP addresses, and special communication parameters are # present when needed. name=brick ; hostip=192.168.2.1 ; nameserver=1 ; gateway=1 #examples: #name=yoyodyne ; hostip=141.142.103.46; nameserver=1 erase=delete #name=yoyo; copyfrom=yoyodyne #name=imsasun.imsa.edu ; hostip=143.195.1.2; erase=delete #name=imsa; copyfrom imsasun.imsa.edu #name=uiucuxa ; hostip=128.174.2.3 ; erase=backspace; #name=uxa ; copyfrom=uiucuxa #name=103gate hostip=141.142.103.145 gateway=1 #name=next hostip=192.42.172.1 gateway=1; erase=delete; consoledebug=1; #outputmap=yes; #name=ncsad ; hostip=128.174.10.48 #name=uicsrd ; hostip=128.174.1.2 #name=csrd ; copyfrom=uicsrd name=brick ; hostip=192.168.2.1; nameserver=1; gateway=1 #name=zoom ; hostip=192.168.2.2 # These are the machines in my own little network == End of telnet.cfg == == passwd - a sample to get you going. == root: 7 c:\ 7 d:\ 7 e:\ 7 f:\ 7 g:\ == end of passwd == == ftpnew.txt - an explanation of the passwd file. == 2.3.07 (and later versions) There is a new background FTP feature: hierarchical permissions FTP connections to your PC are now more secure, because you can define which directories are available to specific users, if you have set up a password file. You may also define whether they may read and write to these directories. This allows the normal FTP setup of an incoming directory which everyone can write to, and public directories which can be read from, while leaving the rest of your PC private. There is also a new option added to the config.tel file (ftpwrt=yes|no) to completely disable writes to your machine from FTP. The Alt-W key still toggles full access for the next FTP connection, as long as FTP is enabled, no matter what the other permissions are. The password file is created with Telpass, and it is *Not Compatable With Older Versions*, so you need to make a new file. The Telpass interface isn't too hot for editing, so anyone with a current password file may want to see the section below on updating the password file with a text editor. You must use the telpass program to create new users though. Any directories specified for a user will be accessable, as well as any subdirectories, unless they are specifically denied in the password file. Each directory in a user's entry has it's own permissions. There is also a root mode, which gives the same access as the Alt-W bypass. See the note below about changing permissions for subdirectories. Root access is denoted with the word "root" instead of any directory names. From telpass, enter the word "root" instead of any drive/directory. If FTP is enabled, there is no way to disable writes for those with root access. When the user completes the connection, they are placed in the first directory on the list. The directory is different from the usual Unix ftp server, where the user begins in a directory mapped to "/". If the first directory does not exist, the user will be denied any connection. The directories should be specified with a full path, including drive. For full access to the c: drive while retaining control over write permissions, set up a user for c: or c:\ instead of "root". If the drive is omitted the search will fail. If many directories have the same ending, you can cut the path short. If the password file is not specified, all users are granted access. Therefore, set your password file in your config.tel. Regardless of the contents of the pasword file, any user sitting at the computer can use the Alt-W sequence to disable password checking for the next FTP access. You can still disable all FTP transfers from the config.tel file. FTP messages are printed on the status screen (Alt-Z if a Telnet connection is open). The messages describe the connection: whether write permission is granted for the starting directory. and whether the password was skipped. =-=-= Note 1: Text editing the pasword file You cannot create a new file or add users without running the Telpass program, but you can easily change existing user's directory permissions with any text editor. The directory trees a user has access to are listed below the user. In front of each tree is a bitmask that specifies permission, just like the Unix "chmod" command, only with one digit. possible values follow: 0 do not allow access 1 allow changing to the directory, but not reading (listing) or writing (put) 2 allow writing only (invalid, because you can't get to the directory anyway) 3 allow changing to and writing, but not reading 4 allow reading (invalid also) 5 allow changing to and reading 6 allow read & write (invalid) 7 allow all access bit 0 allows changing to the directory, bit 1 allows writes, 2 allows read. The number 7 (1+2+4) allows all access. If this confuses you, use the telpass program to edit the permissions, because it's simpler. Note 2: Specifying subdirectory permissions The most specific line in the password file matching the desired directory is used to read the permissions from. This means that access to c:\pub could be read only, and c:\pub\incoming could be write only, if the password file contains both directories. If c:\pub\incoming were not listed but c:\pub were, it would default to the same access permissions as it's parent directory, c:\pub. == end of ftpnew.txt == Again, sorry this is a long email, but I thought I'd better be as complete as needed. Regards, The Viking