Running Telnet and FTP servers with Minix
A default installation of Minix 3 includes ftpd and telnetd. These are the programs used to run FTP and Telenet servers respectively. They are not configured to run by default as they can be a security risk if not configured properly. This post outlines how to run them.
FTP and Telnet are not used as much as they were in the past. Instead SSH is probably more often used for remote access to servers. FTP and Telnet are insecure in that all information is passed as 'clear text' including passwords. There is no encryption like there is with SSH. That said, they are still common protocols and are easy to setup and configure.
The programs for FTP and telnet are called 'in.ftpd' and 'in.telnetd' respectively. They are designed to be run from a script called 'rc.daemons' which lives in the '/etc' directory. A default script exists with the name '/etc/rc.daemons.dist' which shows what the entries should look like.
By creating '/etc/rc.daemons' with the following entries you'll have FTP and Telnet servers running at startup:
To run telnet and FTP without having to restart the system you can manually spawn 'tcpd' as follows:
You will need to put the entries in 'rc.daemons' if you want the servers to start running after a reboot.
Anonymous FTP should be disabled before running 'ftpd' to be safe. To do this, edit /etc/passwd, and remove the 'ftp' user. To enable, keep the 'ftp' user and see the 'ftp' man page. To configure either of these services you should read their 'man' pages:
To work around this you can pass a 'redir' option to 'qemu' which tells it to listen on a particular port on the host machine, and re-route connections from that to a port on the Minix machine. As an example, starting Minix with the following 'qemu':
This creates a port on the host machine numbered '5023' which accepts tcp connections, and passes them to the Minix emulated machine on port '23', the 'telnet' port. So by telnet-ing to port 5023 on the host you can telnet into the emulated machine:
Categories: minix, admin, networking
FTP and Telnet are not used as much as they were in the past. Instead SSH is probably more often used for remote access to servers. FTP and Telnet are insecure in that all information is passed as 'clear text' including passwords. There is no encryption like there is with SSH. That said, they are still common protocols and are easy to setup and configure.
The programs for FTP and telnet are called 'in.ftpd' and 'in.telnetd' respectively. They are designed to be run from a script called 'rc.daemons' which lives in the '/etc' directory. A default script exists with the name '/etc/rc.daemons.dist' which shows what the entries should look like.
By creating '/etc/rc.daemons' with the following entries you'll have FTP and Telnet servers running at startup:
# cat >/etc/rc.daemons'tcpd' is a program that accepts remote connections and passes them to other programs to do work. A line like 'tcpd telnet in.telnetd' says to run 'tcpd' listening on the telnet port (port 23) and run 'in.telnetd' to process the incoming connection. The 'daemonize' at the beginning runs 'tcpd' as a background process, known as a daemon.
daemonize tcpd telnet in.telnetd
daemonize tcpd ftp in.ftpd
CTRL+D
To run telnet and FTP without having to restart the system you can manually spawn 'tcpd' as follows:
# intr -d tcpd telnet in.telnetd &The 'intr' command spawns the process with input from /dev/null and output to /dev/log. The '-d' and the '&' spawn the process in the background and immediately returns to the shell.
# intr -d tcpd ftp in.ftpd &
You will need to put the entries in 'rc.daemons' if you want the servers to start running after a reboot.
Anonymous FTP should be disabled before running 'ftpd' to be safe. To do this, edit /etc/passwd, and remove the 'ftp' user. To enable, keep the 'ftp' user and see the 'ftp' man page. To configure either of these services you should read their 'man' pages:
# man telnetdIf you are running Minix in an emulated environment like 'qemu' you won't be able to access these servers from the host machine, or any other machine except for those participating in the 'qemu' network. This tends to limit the reason for running the server in the first place!
# man ftpd
To work around this you can pass a 'redir' option to 'qemu' which tells it to listen on a particular port on the host machine, and re-route connections from that to a port on the Minix machine. As an example, starting Minix with the following 'qemu':
qemu -localtime -hda minix.img -net user -net nic -redir tcp:5023::23
This creates a port on the host machine numbered '5023' which accepts tcp connections, and passes them to the Minix emulated machine on port '23', the 'telnet' port. So by telnet-ing to port 5023 on the host you can telnet into the emulated machine:
telnet localhost 5023The format of the 'redir' options is {tcp or udp}:{host port}:{guest ip/name}:{guest port}. In the example above we skipped the 'guest ip/name' as it defaults to 10.0.2.15 which is assigned by default in 'qemu'.
Categories: minix, admin, networking

3 Comments:
I can connect to minix from MacOS using ftp or ncftp; it does log in but then nothing works.
$ ncftp minix
NcFTP 3.1.9 (Mar 24, 2005) by Mike Gleason (http://www.NcFTP.com/contact/).
Connecting to 127.0.0.1...
FTP service (Ftpd 2.00) ready on 10.0.2.15 at Sun, 18 Jun 2006 14:42:01 GMT
Logging in...
User matteo logged in, directory /home/matteo.
Logged in to localhost.
Current remote directory is /etc.
ncftp /etc > get passwd
Invalid reply: "."
get passwd: invalid reply from server.
Strange, does it work with ftp from a non-mac system? Are you running Minix from within an emulator or on a real machine?
You might want to try using passive ftp, or if you are using that, turning passive off.
I can connect to minix from Linux using ftp; it log in normally but when i try to use some commands like: *ls, get*.... It didn't work and an error occured: *501 syntax error in parameters*.
I also use QEMU
Post a Comment
<< Home