PDA

View Full Version : How to allow logon to the Knoppix machine via Telnet and ftp



chip.ling
02-18-2006, 05:30 AM
I am trying to setup a local test network with 2 computers and a switch. It will not connect to the internet so security is not an issue.

One computer running Knoppix and the other running Windows XP.

Both computers connect to the switch. I use ifconfig command to set up the ip address and subnet mask of the Knoppix box and also through windows to setup the windows machine's ip.

I can ping both machines (windows one ping to the knoppix one and vice versa)

Now I want to telnet and ftp to the Knoppix box from the windows box. But I have no luck at all.

Any one can tell me what I need to setup to achieve this? Thank you.

Harry Kuhman
02-18-2006, 06:15 AM
Any one can tell me what I need to setup to achieve this? Thank you.
Assuming that your setting are correct (I have no reason to think that they are not), all you need is a FTP server on one side and a FTP client on the other. Knoppix has Konquror that works just fine as a FTP client, so I suggest installing a FTP server on the windows box. You should then be able to log into the server by putting ftp://xxx.xxx.xxx.xx into the Konquror address bar (where the x's are the IP address of the windows box).

You might want to tell us what you have done and what is not working, as it's hard to guide you in what you are doing wrong without this information.

chip.ling
02-20-2006, 08:24 PM
Alright, here's the detail:

2 PCs hook up to a five ports switch with straight thru cat 5 cables.

One PC running Win XP, the other Knoppix V4.0.2 (boot from CD)

Boot up both machine so Win XP and Knoppix X-window are up and running.

Win XP machine:
1. set up the TCP/IP setting to: IP address=192.168.255.1, Subnet mask=255.255.255.0, default gateway=none.
2. Start the Telnet service (control panel ==> admin tools ==> services).

Knoppix machine:
1. Start Shell-Konsole session.
2. Type in the command, ifconfig and then hit enter. I see the lo is ready at inet address 127.0.0.1 with mask 255.0.0.0.
3. Setup the eth0 using the following command.
sudo ifconfig eth0 192.168.255.2 netmask 255.255.255.0 broadcast 192.168.255.255

From the Win XP machine:
1. open the DOS box and ping 192.168.255.2
2. Ping result is good.

From the Knoppix machine:
1. ping 192.168.255.1
2. Ping result is good.

*** Sound like a good beginning ***

From the Knoppix machine:
1. telnet 192.168.255.1
2. It starts the telnet session and the following prompt returns and ask for login id:
Welcome to Microsoft Telnet Service
login:?

I am not interest to telnet to the Win XP machine, so I do not setup user id on the Win XP. I control-C and back to the shell.
But I'm sure I can telnet to the Win box.

*** Note: so far so good up until here ***

Now I want to setup and start the telnet service on the Knoppix box.

From the Knoppix box:
1. sudo vi /etc/inetd.conf
2. I view the inetd.conf file, here are the related services entries. (I skip the rest not related)
ftp stream tcp nowait root /usr/sbin/tcpd /usr/sbin/inftpd
tftp dgram upd wait root /usr/sbin/in.tftpd in.tftpd /boot
#<off># telnets stream tcp nowait sslwrap.sslwrap /usr/sbin/tcpd /usr/sbin/sslwrap -nocert -addr 127.0.0.1 -port 23
#<off># ftps-data stream tcp nowait sslwrap.sslwrap /usr/sbin/tcpd /usr/sbin/sslwrap -nocert -addr 127.0.0.1 -port 20
#<off># ftps stream tcp nowait sslwrap.sslwrap /usr/sbin/tcpd /usr/sbin/sslwrap -nocert -addr 127.0.0.1 -port 21
3. I delete the three "#<off>#" from the inetd.conf and then save the file.
4. sudo /etc/init.d/inetd reload
5. The system responses back: Reloading internet superserver: inetd.

*** Seems OK to me ****
6. ps -ef
7. Cannot find any process related to telnetd or ftpd. (Is it normal???)

*** Don't sound good to me ***
8. Try to start telnet from the WinXP box to the Knoppix box (that's what I really want)
9. From DOS: telnet 192.168.255.2
10. Got the following error message:
Connecting to 192.168.255.2...Could not open connection to the host, on port 23: Connect failed.

*** Try other stupid way and see if it works ***
1. add the following entry to the inetd.conf file
telnet stream tcp nowait root /usr/sbin/tcpd /usr/sbin/in.telnetd
2. sudo /etc/init.d/inetd reload
3. Try again but the same result.

*** Revisit the port 23 definition entry on the inetd.conf file ***
It says:
telnets stream tcp nowait sslwrap.sslwrap /usr/sbin/tcpd /usr/sbin/sslwrap -nocert -addr 127.0.0.1 -port 23

I notice the unusual "sslwrap" words are there, does that means the telnet in Knoppix is not function as the old telnet we used to use? Looks like it tries to use some kind of secure shell type of authentication checking here.

Any body has any input? What is my next step in order to make my telnet run?

Rgds
Chip

Harry Kuhman
02-20-2006, 08:44 PM
OK Chip, good information there. You clearly have the network going and the XP firewall in sp2 is not givig you any problems. I have never enabled telenet in Knoppix so can't tell you how to do that, but I've seen many people talking about telenet or a terminal server, I would expect that you can find plenty of info with the site search function. As to FTP I have looked for a FTP server on the CD but never found one (not at all sure about the DVD). Since I already have FTP servers that I run on Windows I just went the other way and used Knoppix as the client (whoch Konquror works great for). But it would be nice to know if there is a FTP server on the CD or DVD; I hope someone who has managed to get one to work will join in.

chip.ling
02-20-2006, 10:29 PM
Harry,

You reminds me. I never check the existence of such programs I want to use, I just assume it was there.

So I went to do a search of the program telnetd and ftpd and cannot find it on my Knoppix box.

Here is what I did:

cd /
find . -name telnetd -print | grep telnetd

The search result is as follows
/KNOPPIX/usr/lib/telnetd
/UNIONFS/usr/lib/telnetd

I went to both of these directories and they are empty.

I did another search for the ftpd and the result is also negative.

find . -name ftpd -print | grep ftpd

The search result is:
/KNOPPIX/usr/share/doc/ftpd
/UNIONFS/usr/shar/doc/ftpd

Maybe we need to write our own telnetd and ftpd if we really want to use it.

Rgds,
Chip

chip.ling
02-20-2006, 10:42 PM
Harry,

I got an idea, since I cannot find the telnetd and ftpd program on the Knoppix, definitely we cannot run it. Don't waste your time try to find it on the DVD or CD, maybe the Knoppix creator does not like them and did not include them in the CD.

Since the Knoppix is based on Debian Linux. I went to the Debian web site http://packages.debian.org/stable/allpackages.html

I found the following packages you might be interested.

ftpd, ftpd-ssl, telnetd, telnetd-ssl

I think if we download the ftpd and telnetd (or ftpd-ssl and telnetd-ssl if you think security is important) packages and install on the top of our current Knoppix. You should be able to have the ftp server up and running.

What do you think?

Rgds,
Chip

kirol
02-20-2006, 11:08 PM
Unless you specifically want telnet/ftp (for which clients are included on XP), why not start sshd on knoppix (/etc/init.d/ssh start), then use putty (http://www.chiark.greenend.org.uk/~sgtatham/putty/) and winscp (http://winscp.net/eng/index.php) from the windows client?

chip.ling
02-21-2006, 12:10 AM
Actually, I am able to connect from the Win XP box to the Knoppix box using ssh and putty combination before I post the question. That's the standard I'm using at work from my windows xp to the sun box.

From the Knoppix box, I run the following commands
1. sudo passwd
2. change the su password
3. sudo passwd knoppix
4. change the knoppix password
5. sudo /etc/init.d/ssh start
6. the ssh process kicks off

Then from the Win XP box, start the putty gui and enter the ip address. And it works.

But I just hated that I cannot do what I originally plan to do. I think it is a straight forward action but it ends up like a dead end.

I still pursuing the problem not because I will use it in the future for any production environment. (definitely not, security is a big issue).

But I think users should be given a chance to decide what they want to use instead of the provider put the applications on the table and say "here is what you can use, use it". (Sounds like Bill Gate to me)

Isn't that the spirit of Linux?

Also I'm new to Linux too, I wish that I can install a package to the Linux.

Rgds,
Chip

Harry Kuhman
02-21-2006, 01:10 AM
Since the Knoppix is based on Debian Linux. I went to the Debian web site
I found the following packages you might be interested.

ftpd, ftpd-ssl, telnetd, telnetd-ssl

I think if we download the ftpd and telnetd (or ftpd-ssl and telnetd-ssl if you think security is important) packages and install on the top of our current Knoppix. You should be able to have the ftp server up and running.

What do you think?
What I think is that although Knoppix is based on Debian it is not Debian. I can't install to the CD. The UnionFS may actually help here, but I've never got it working quite right.

Installing packages under Knoppix tends to break things. Knoppix is a mix of different Debian releases and the parts are not always compatable. Installing and/or updating programs with Knoppix triggers incompatabilities (in technical terms it mucks stuff up). . So I use Knoppix as the Live CD or DVD that it was intended. If people want to install more I suggest that they use Debian.

I do have a copy of real Debian installed on hard disk on one of my computers. I can certainly install these or any of the many many Debian packages under Debian; the assortment included with Knoppix is just a small sub-set. I didn't get into that because it doesn't really answer your question, but if you can get an install to work without causeing other problems, good for you.

Harry Kuhman
02-21-2006, 01:20 AM
I wish that I can install a package to the Linux.
Knoppix is a live CD (or DVD). A lot of applications were included but space was an issue, particularly for the CD, and it may not be unreasonable for them to have left out a insecure ternminal application when they had a secure system that did the same. I'm more bewildered by the apparent lack of a FTP server, since FTP is so simple and common. But unless you remaster you can't install to the CD, and I've alread gone over the issues about installing to Knoppix above (see also my answer #2 (http://www.knoppix.net/wiki/User:Harry_Kuhman)). My advice is that if you want an easy to try Linux or a portable Linux that can quickly be placed on almost any computer, use a Live CD like Knoppix. But if you want to install your own choice of software, customize the look and feel of the desktop and GUI (or even the shell) , and make other changes that Linux allows you to make so well, use a Linux that is intended for hard disk. Debian is one and is the one that Knoppix is based on.

chip.ling
02-21-2006, 06:41 PM
Looks like it's going to be a challenge to have the telnetd and ftpd up and running.

Anyway, I have the putty and psftp up and running on the windows xp box and ssh on the knoppix box right now. The putty.exe and psftp.exe are small in size so I can alway put them on a pen drive or floppy with me.

I need to do more research on the newsgroup before I can proceed for the attempt to put ftpd and telnetd back to the knoppix.

Rgds,
Chip

chip.ling
02-21-2006, 10:31 PM
I did my first trial to install ftpd on the top of a running Knoppix but fail.

My original plan was download a binary ftpd package and install the package on the top of the Knoppix I'm running.

With my windows XP laptop connected to the internet, went to the http://packages.debian.org/stable/allpackages.html site but cannot download the binary package. So I decided to go the hard way, download the source tar file from the site. (linux-ftpd_0.17.orig.tar.tar)

Then I connect my XP box to the local network I had with the Knoppix box, sftp the file to the Knoppix box to the directory /home/knoppix/tmp

Expand the tar file by "tar -xvf linux-ftpd_0.17.orig.tar.tar"

The whole source was expanded to /home/knoppix/tmp/linux-ftpd-0.17

There are two more directories within the directory linux-ftdp-0.17, one is support and the other is ftpd. I went into both of the directories and find they have some c programs in there. Both directory has their own Makefile. The ftpd Makefile references to the support directory. So I start compile the support one first.

Went to the support directory and type in "make".

Error came back complaining the first line on the Makefile "include ../MCONFIG". Check the parent directory, there is no such file called MCONFIG, but instead there is one called MCONFIG.in. I edited the Makefile to point to the MCONFIG.in file and re-try again.

No good, this time complained about missing separator in the MCONFIG.in file. So I commended out the line "include ../MCONFIG"

Try again, this time compilation went through. I inspect the directory, all the object files are there.

Went to the ftpd directory, did the same thing and also need to change the 1st line of the Makefile, (i.e. commented out the include ../MCONFIG line)

But this time the compilation cannot finish, I got the error message

ftpd.o: In function 'pass':
ftpd.c: (.text+0x121e): undefined reference to 'crypt'
collect2: ld returned 1 exit status
make: *** [ftpd] Error 1

I don't have much knowlege on the Makefile nor the compile of programs so I just stop here. But I feel it maybe related to the 1st line I commented out on the Makefile.

Because when I browse the MCONFIG.in file, the content is as follows

### begin of the file
# Dirs
INSTALLROOT
SBINDIR
MANDIR

# Modes
DAEMONMODE
MANMODE

# Compiling
ALLWARNINGS
CC
CFLAGS
LDFLAGS
LIBS
YACC

# Features
BSDSIGNAL
SHADOW
FN(crypt)
FN(snprintf)
TYPE(socklen_t)

### End of the file

I suspect the problem related to the MCONFIG.in file because the error message I got containing the word 'crypt' which I can find on the MCONFIG.in file.

Has anybody encounter this problem before and know how to solve it?

Rgds,
Chip

Harry Kuhman
02-21-2006, 10:46 PM
I did my first trial to install ftpd on the top of a running Knoppix but fail.
If you feel that you must add software to the live CD, try this suggestion:
Go to the KLIK forum and read about Klik.

Go to the Klik website and see if there isn't a FTP package thay can make just for you and download to your system.

If for some extremely strange reason there is not a FTP package available, post a message asking for one. Probono is great about such things and is extremely like to help you out.

chip.ling
02-21-2006, 11:39 PM
Thanks for the direction.

Rgds,
Chip

Harry Kuhman
02-23-2006, 01:13 AM
I just want to add to this that the Knoppix CD package list (as well as the DVD list) shows that the ftp server ftpd is included on the CD. But I can't find how to start it or how to configure it on a live CD (which makes one wonder why even waste the space). Typing ftpd at a shell prompt doesn't seem to find it.

chip.ling
02-23-2006, 08:29 PM
In that case, I believe the program ftpd is inside the CD. Just don't know how to retrieve it back so that the Linux FS can see it.

kirol
02-23-2006, 09:59 PM
Both in.ftpd and in.telnetd are present under /usr/sbin. By default, inetd is not started, though. Just issue (as root) "/etc/init.d/inetd restart". This will start inetd, which has a line to enable the ftp service. By default ftpd is under control of tcpd, which means you need to adjust /etc/hosts.allow and/or /etc/hosts.deny to allow other systems to connect (localhost seems alright). You can also run ftpd without tcpd supervision by replacing /usr/sbin/tcpd directly by /usr/sbin/in.ftpd - no need to tamper with the /etc/hosts.* files in this case. I could not get a similar trick to work for telnetd, though; it seems to insist on using SSL...

chip.ling
03-07-2006, 06:14 PM
I just want to add to this that the Knoppix CD package list (as well as the DVD list) shows that the ftp server ftpd is included on the CD. But I can't find how to start it or how to configure it on a live CD (which makes one wonder why even waste the space). Typing ftpd at a shell prompt doesn't seem to find it.

Harry, I finally made the ftpd works. Here is what I did.

Step 1: start the machine with Knoppix on the cd rom and have the network portion setup. (i.e. IP address of the machine is defined). Also add passwd to root and knoppix.

Step 2: Edit the hosts.deny and hosts.allow files

sudo vi /etc/hosts.deny
(delete the line 'ALL:PARANOID' and save the file)

sudo vi /etc/hosts.allow
(modify the line 'ALL : ALL@ALL : DENY' to 'ALL : ALL@ALL : ALLOW' and save the file)

(Or define the machines you can logon to the host in the hosts.allow file, that should be the way for security purpose).

Step 3: sudo /etc/init.d/inetd restart

Step 4: from a remote machine, start the ftp client and connect to the knoppix host using the knoppix. Now the ftp server is up and running in the knoppix machine. I can connect to the knoppix box via ftp.

I still not able to make telnet server up and running but I use ssh instead at this point.

Step 5: sudo /etc/init.d/ssh start

ssh is up and running and I can connect to the knoppix host via putty from the other windows Xp machine. I test both the ssh connection and the ftp connect and they can be both exist without conflict.

Rgds,
Chip

A. Jorge Garcia
03-08-2006, 05:05 PM
If you knoppix-install to a harddrive, the ssh client is up and running by default - so you can ssh to another ssh server.

If you want a knoppix-installered box to be a ssh server, simply open a root shell and issue the following commandline:


update-rc.d ssh defaults
and your ssh server should be up and running. This should setup sshd correctly for you. BTW, you only have to do this once on any given ssh server you want to set up.

I have a knoppix-installered LAN for my computer science students. I setup up one box as a ssh server that they can all log-into from anywhere in the school and from home to compete their work and save their files. They use ssh userid@xxx.xxx.xxx.xxx from a shell and fish://userid@xxx.xxx.xxxxxx from Konqueror mostly. Sometimes, we'll use sftp as well.

HTH,
AJG

chip.ling
03-23-2006, 05:35 AM
[quote="chip.lingI finally made the ftpd works. [/quote]

Oop, just find a little problem. Using the steps I mentioned before, 'knoppix' id is the only id I can logon to the knoppix box via ftp.

I created another user account, able to use that id/password connect to the knoppix box via putty. But when I tried to logon to the knoppix box by ftp using the newly created account. I got a '530 Login incorrect. Login failed' ftp error.

Then I tried to use the 'root' account and it reponsed back with the same error message.

Anyone knows how to fix it? I am thinking maybe the newly created account need to be in a special group. But then what group it should be in?

Rgds,
Chip

maxIT
05-12-2006, 06:24 PM
I still not able to make telnet server up and running but I use ssh instead at this point.

Ok ok, ssh is 'the best', more secure and so on. But why the hell a poor man in his own network without secure-isssues can't simply 'telnetting'?

Maybe just to save resources?

root@ttyp0[bin]# ls -lh /usr/bin/ssh
-rwxr-xr-x 1 root root 224K Apr 6 2004 /usr/bin/ssh
root@ttyp0[bin]# ls -lh /usr/bin/telnet-ssl
-rwxr-xr-x 1 root root 85K Jun 2 2003 /usr/bin/telnet-ssl

If someone cute person know exactly how to enable a telnet-server in knoppix I will appreciate it very much :D