PDA

View Full Version : How do I make my Knoppix PC into an ftp server?



markbuenafe
01-11-2003, 01:31 AM
I would like to make my PC running KNOPPIX into a temporary FTP server.
I want to share some files as well as help my Win98 friends turn their PCs into FTP server without installing new software. I know how to mount my D drive (FAT32) so that it is read-write.

How do enable the ftp service?
What do I need to do to make a directory /d/share available to ftp clients?
Can I create guest ftp accounts?

Thanks!
Mark

roberto
01-11-2003, 08:15 AM
to mount a volume read-write simply right-click on it and select mount as read-write. for details see here:

https://sourceforge.net/docman/display_doc.php?docid=14675&group_id=70773

as far as FTP server im pretty useless for now!

thx

Dave_Bechtel
01-17-2003, 09:33 AM
--I actually managed to do this once, to bkp my Dad's rig... AFAI can remember:

UPDATE: 2003-0123
UPDATE: 2003-0125

On Knoppix, as root of course:

1. ' /etc/init.d/inetd start ' == Start FTP daemon (see /etc/inetd.conf)
1a. ' ps ax ' -- You should see inetd running.

2. ' ls -l /etc/hosts ' == You will see the symlink (optional)

3. ' rm /etc/hosts ' == Remove non-editable symlink
3a. ' rm /etc/hosts.allow ' == Remove non-editable symlink

4. ' cp /KNOPPIX/etc/hosts /etc ' == Copy from wherever the LS sez
4a. ' cp /KNOPPIX/etc/hosts.allow /etc '

5. ' jstar /etc/hosts ' == Use your favorite editor, and add in the CLIENT's IP address and machine-name, as well as the Knoppix box's info. (' man hosts ')

It should look like this:
#
# hosts This file describes a number of hostname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
# On small systems, this file can be used instead of a
# "named" name server.
# Syntax:
#
# IP-Address Full-Qualified-Hostname Short-Hostname
#
# special IPv6 addresses

127.0.0.1 localhost
10.0.0.1 hostbox.melvinseries.org hostbox

10.0.0.2 clientbox.melvinseries.org clientbox


5b. ' jstar /etc/hosts.allow ' == Comment out the last line, that says:


ALL : ALL@ALL : DENY
...with a '#' char at the beginning of the line:


#ALL : ALL@ALL : DENY


6. ' killall pump ' == If you need to manually config your eth0
6a. Make sure you have eth0 up and running:
' ifconfig eth0 10.0.0.1 netmask 255.0.0.0 up '
(...or 192.168.1.0 / 255.255.255.0 or whatever)

7. Ping the client box and the Knoppix box from both sides using numeric IP (10.0.0.1)

8. ' passwd knoppix ' == Assign a password to knoppix user (can be 'blah' or whatever is convenient. UPDATE: This works from CD with no additional changes.) You can also do ' adduser whatever ' and then ' passwd whatever ' but then you have to "copy-down" /etc/gshadow before the "adduser."

--To ftp to Knoppix box from Linux:
' ncftp -u knoppix 10.0.0.1 ' == It will ask for the password, and you should be good to go.

--You may have to edit /etc/fstab for your FAT32 partition to make it *writable* - post again if you need help with this. It should be *readable* by anybody logging in.

--Now the original post is all from memory, but it SHOULD work. I've updated it with what worked for me. Let me know if it doesn't, and I'll try doing it again on my Knoppix rig.

--NOTE: Securing the box is YOUR responsibility. This is just a quick-n-dirty hack to get FTP downloads up and running.


I would like to make my PC running KNOPPIX into a temporary FTP server.
I want to share some files as well as help my Win98 friends turn their PCs into FTP server without installing new software. I know how to mount my D drive (FAT32) so that it is read-write.

How do enable the ftp service?
What do I need to do to make a directory /d/share available to ftp clients?
Can I create guest ftp accounts?

Thanks!
Mark

Hermanh
01-20-2003, 10:21 PM
I did try this exactly as it's writen down, but I had trouble to log in.
I was also not able to add a user. Is it possible that this is because I am running frm CD?
Or need the user knoppix other rights? I also tried to login with user root. This did also not work. And I thought root should have all rights, but I am not a very experienced Linux-user.

The client I use is a Windows 98 client. On the console of knoppix I could see that that machine has tried to log in, but the user-field stayed empty, also the password field stayed empty.
On the client I did get the logon-screen.
What could be wrong?

Dave_Bechtel
01-22-2003, 03:55 PM
--Sorry about that; I'll have to look into it. Hopefully a solution will present itself by tomorrow. BTW, most secured Linux installations will not allow root to login remotely. You have to login as somebody else and ' su ' to root (you have to know root's password and be in the "su" config file for this IIRC.)

--Post exactly how you are trying to login from Win98; if I interpret you correctly, you're using the DOS FTP command. You have to login as "knoppix" and use the password that you assigned on the Knoppix box for the knoppix userid.

--As for adding another userid, check and see if /etc/passwd and /etc/groups are symlinks to the cdrom; if so, you'll have to copy them down to /etc as already described, so they can be changed.

--Also see this thread (Hermanh at 8:53 am) for more info:
http://www.knoppix.net/forum/viewtopic.php?t=497


I did try this exactly as it's writen down, but I had trouble to log in.
I was also not able to add a user. Is it possible that this is because I am running frm CD?
Or need the user knoppix other rights? I also tried to login with user root. This did also not work. And I thought root should have all rights, but I am not a very experienced Linux-user.

The client I use is a Windows 98 client. On the console of knoppix I could see that that machine has tried to log in, but the user-field stayed empty, also the password field stayed empty.
On the client I did get the logon-screen.
What could be wrong?

Hermanh
01-22-2003, 07:40 PM
Dave_Bechtel,

:D I did succeed in addinjg a user. So that part is solved.

I tried to connect to knoppix using MS internet explorer 6.0.
I just put ftp://192.168.0.10 in the adress.
I got the login-screen, but I could not connect to the ftp-server.

:? It is saying that the user - password combination is wrong, although I'm sure it was the right one.

:? I tried it with 3 different users (root, knoppix and the new one). I read that knoppix also was not allowed to login remotely in the security-file on the CD. Maybe the new made user has the same profile, but I do not know where to change that.

:twisted: I also tried an FTP-client, called FTP-explorer. I've got exactly the same problem with that one.


:shock: Just for your information:

What I want is an FTP-server to connect to through the internet, when I'm helping people with their computers at their homes. The server will only be activated when I'm doing that or when I'm working on one of the PC's in my own network. All the (7) clients are Windows-machines (Win98SE and/or WinXP corp).

Next step will be finding out how to prevent remote users to get into knoppix and ruin everything. The first step, to put root in the file ftpusers was already done on the CD. I would like to redirect the ftp-user's home-directory to /mnt/HDA1/ftp/ and remove all other rigths, I'll first try to find out how myself.

After I have the FTP-server running and configured, I have to confige my firewall, so it can be contacted from outside, without people getting into my home-network.
So this machine will be in a different network as soon as it's running.
:wink: My firewall is also a Linux machine, but not Knoppix. That distro works from a floppy on a 486 with only 16 MB memory, no harddisk, no CD-drive and the floppy removed as soon it's running.

:!: If that's working I think I will try to remaster the CD, so everything I want will be on that CD. The original I will probably use next to Win98SE and WinXP on my own PC (as workstation).

:idea: So you will probably see more topics from me just needing a little push to get to the next step.

Thanks for your reaction so far.

Hermanh
01-23-2003, 01:00 PM
I noticed that my harddisk stayed read-only allthough I did change that on the desktop. Also user knoppix could not write to the disk. I think it's caused by the fact I'm using a swap-file. This is also the reason why I could not remount hda1 as root.
Could this also be the problem users cannot connect remote?

Dave_Bechtel
01-23-2003, 07:12 PM
--Did you try ' mount /dev/hda1 /mnt/hda1 -oremount,rw ' as root?

--BTW, see me edited post above; I got it working.


I noticed that my harddisk stayed read-only allthough I did change that on the desktop. Also user knoppix could not write to the disk. I think it's caused by the fact I'm using a swap-file. This is also the reason why I could not remount hda1 as root.
Could this also be the problem users cannot connect remote?

Hermanh
01-23-2003, 09:07 PM
:D I've got the harddisk mounted rw. Thank you.

:cry: The login on the ftp-server does not function jet.
I've changed hosts.allow like you told me.
That did not work.

I've added an extra line:

ALL : ALL@ALL : ALLOW
That did not work.

:wink: To add a new user I still have to remove the symlink and copy /KNOPPIX/etc/gshadow to /etc/gshadow.

:roll: I still get an error-message on adduser, but the new user exists (incl. /home/new user).
The message is:

rpcinfo: can't contact portmapper: RPC: remote system error - connection refused
This message appeared 3 times
After that the home-directory is created, etc.

Hermanh
01-23-2003, 09:37 PM
This is what I did so far:

As root:

modprobe 3c509

As knoppix:
goto K -> knoppix -> Network/internet -> Network card configuration
IP: 192.168.0.10
Netmask: 255.255.255.0
Broadcast: 192.168.0.255
Gateway: 192.168.0.2
DNS: 62.251.0.6 62.251.0.7

As Root:

mount /dev/hda1 /mnt/hda1 -oremount,rw
/etc/init.d/inetd start
cd /etc
rm /etc/hosts
rm /etc/gshadow
rm /etc/hosts.allow
cp /KNOPPIX/etc/hosts hosts
cp /KNOPPIX/etc/gshadow gshadow
cp /KNOPPIX/etc/hosts.allow hosts.allow
jstar hostsOn second line added:

192.168.0.51 hah
192.168.0.10 knoppix
192.168.0.2 t-floppy^kx

jstar hosts.allow
Commented last line out and added:

ALL : ALL@ALL : ALLOW^kx

adduser newuser

And then tried to login on ftp:/192.168.0.10 from my win98 box (IE explorer 6.0 and FTP explorer) as newuser and as knoppix. I do get the login screen, but could not logon:
Translated error-message (from dutch):
logon to FTP server with given username and given password is not possible

I also tried to login as newuser on the knoppix-box itself. No problems with that.

Hermanh
01-25-2003, 05:46 PM
I've tried this again. This time I configured the knoppix-box started in text-mode (cheatcode: knoppix 2 expert) and logged in as user knoppix.
Of course I did give knoppix a password by typing:

passwd knoppix, etc., etc., etc.

The result on the Win98-box are the same as earlier.

On my knoppix-box console the following apeared:

ftp(pam-unix)[947]: authentication failure; logname= uid=0 euid=0 tty= ruser= rhost=192.168.0.51 user=knoppix
ftp(pam-unix)[954]: auth could not identify password for [ftp]

I am sure I used the right password and username.
I also tried on the Win98-box in IE 6.0 to use the following adress:

ftp://knoppix:pass@192.168.0.10
IE explorer did exactly the same as when I typed

ftp://192.168.0.10

So what could there be wrong?
I think there might be 2 causes for this:

1. I do something wrong in the host-file.
Maybe the information I put in the host-file about the knoppix-machine is wrong.
I did gave some information about the client, but I think that should not be needed.
If it's needed I still have a problem when I want to connect over the internet.
I do not always know in front on which machine I'm working.
Or should I just put in the information of the firewall/router which will be the first hop for the knoppix-box?

2. There is something wrong with the user.
I'm still getting error-messages when adding a user with adduser

I hope someone can answer me what I have to do to get things working.

Thanks.

Dave_Bechtel
01-25-2003, 10:14 PM
--I updated the instructions again, and have used them myself several times now in the past couple of days. Suggestion:
1. Do *everything* exactly as written, in Knoppix, from text-mode root console (Ctrl-Alt-F1) - real sysadmins don't use GUI for configuration... :P

2. Boot Knoppix also on the *client* machine, and manually ifconfig eth0 to
"ifconfig eth0 10.0.0.2 netmask 255.0.0.0 up"

--Then see if it works using ncftp as described. Once you have it working, you can reboot the client box to Win and try it from there. (Of course you will have to reconfig the server for 192.168... and the new netmask, but Linux makes it easy.) If it still doesn't work on the Win side, try the DOS ftp client.


I've tried this again.
The result on the Win98-box are the same as earlier.

On my knoppix-box console the following apeared:

ftp(pam-unix)[947]: authentication failure; logname= uid=0 euid=0 tty= ruser= rhost=192.168.0.51 user=knoppix
ftp(pam-unix)[954]: auth could not identify password for [ftp]

I am sure I used the right password and username.
I also tried on the Win98-box in IE 6.0 to use the following adress:

ftp://knoppix:pass@192.168.0.10
IE explorer did exactly the same as when I typed

ftp://192.168.0.10

So what could there be wrong?
I think there might be 2 causes for this:

1. I do something wrong in the host-file.
Maybe the information I put in the host-file about the knoppix-machine is wrong.
I did gave some information about the client, but I think that should not be needed.
If it's needed I still have a problem when I want to connect over the internet.
I do not always know in front on which machine I'm working.
Or should I just put in the information of the firewall/router which will be the first hop for the knoppix-box?

2. There is something wrong with the user.
I'm still getting error-messages when adding a user with adduser

I hope someone can answer me what I have to do to get things working.

Thanks.

01-26-2003, 03:35 AM
The FTP-server is working.
I'm in! (from

The problem was the file ftpusers. This was also a symlink. As soon as I removed that link and copied the file from /KNOPPIX/etc to /etc the problem was solved.

I did also do some changing on the file hosts, but that did not solve the problem.

I came to the right answer by an error-message on the console after 5 retries.


Dave_Bechtel thanks for your time and everything. I know how desperate one can get if not exactly is done what you asked. Or how difficult it is to get your hands on the right spot when things go wrong. I do a lot of support for Windows on a dutch forum. So I know exactly how it feels. Again, thanks a lot.

Hermanh
01-26-2003, 01:14 PM
I've tried it again with my old file hosts. And it does work also. So I did read the man-pages on hosts right. If you use a non dotted host-name you are supposed to be in the same network.

I think I just should let you know.

Again thanks.

Dave_Bechtel
01-27-2003, 09:27 AM
--Glad it finally worked. :) I kinda suspected the ftpusers file, but in the latest ISO rev it's not a problem. Always make sure you have the latest DL. 8)


The FTP-server is working.
I'm in! (from

The problem was the file ftpusers. This was also a symlink. As soon as I removed that link and copied the file from /KNOPPIX/etc to /etc the problem was solved.

I did also do some changing on the file hosts, but that did not solve the problem.

I came to the right answer by an error-message on the console after 5 retries.


Dave_Bechtel thanks for your time and everything. I know how desperate one can get if not exactly is done what you asked. Or how difficult it is to get your hands on the right spot when things go wrong. I do a lot of support for Windows on a dutch forum. So I know exactly how it feels. Again, thanks a lot.

01-27-2003, 05:07 PM
Just for a little bit more security:
I changed the file hosts.allow
It looks now like this:

inetd : ALL@ALL ALLOW
ALL : 127.0.0.1 LOCAL : ALLOW
ALL : ALL@ALL : DENY

Hermanh
01-28-2003, 12:31 AM
Also for security reasons I did change several settings in inetd.conf.
From the external services is now only FTP running.

roberto
03-03-2003, 07:55 AM
ok ... that was cool... if it is ok with everyone i think i will clean this post up a little and make it one of the how-to's on the knoppix doc forum. let me know if youy have any special requests, or objections.

http://sourceforge.net/docman/?group_id=70773

toast

again dave is da' man :-p

kevinkaseykizer
03-11-2003, 08:08 PM
hey everyone, i have gotten my ftp up and running just fine thanks to all of you.....but one question....i have my hard drive mounted but how do i get to it from the ftp?

all i can see the ramdrive


thanks

A. Jorge Garcia
10-29-2003, 02:43 AM
Does any of the above apply if I just want to ftp across a LAN (intranet - in my lab at school). I tried everything in FAQFTP and got no where....

I rm'd hosts.deny and hosts.allow and restarted inetd on the "ftp server" but when I ftp from a client I get a time out after logging-in and just trying to ls! BTW, the client is a KNOPPIX liveCD and the server is knoppix-intalled as debian.

Please help!

TIA,

A. Jorge Garcia
10-31-2003, 12:54 AM
I just got this sort of working with fish. I needed to setup sshd on the server and ssh on the clients. Is there some equivalent ftpd I need on the server?

TIA,

Hermanh
11-03-2003, 06:38 PM
Well, I finaly found time to trie configuration of SSH on my FTP server using Knoppix 3.1. Started the box in text-mode as usual.
Tried to start SSH with
sshstart It gave an error-message:

rxtv: can't open display : 0
What can be wrong?

etierjr
11-05-2003, 11:24 PM
Well, I finaly found time to trie configuration of SSH on my FTP server using Knoppix 3.1. Started the box in text-mode as usual.
Tried to start SSH with
sshstart It gave an error-message:

rxtv: can't open display : 0
What can be wrong?

How about this as root#

/etc/init.d/ssh start

Hope this helps

Hermanh
11-06-2003, 12:13 AM
I've read that sshstart was a script which takes care of configuration also.
ssh start does start SSH, but does not do anything to configure the server.

A. Jorge Garcia
11-06-2003, 12:44 AM
Try <K><KNOPPIX><SERVICES><START SSHD>

Enjoy,

Hermanh
11-06-2003, 01:18 AM
That does not work in text mode.

A. Jorge Garcia
11-06-2003, 01:31 AM
Why must you run in text mode?

Regards,

A. Jorge Garcia
11-06-2003, 01:33 AM
ok ... that was cool... if it is ok with everyone i think i will clean this post up a little and make it one of the how-to's on the knoppix doc forum. let me know if youy have any special requests, or objections.

http://sourceforge.net/docman/?group_id=70773

toast

again dave is da' man :-p

OK, what was cool, dave who and what exactly are you referencing from docman?

Regards,

Hermanh
11-06-2003, 09:40 AM
I did an upgrade to Knoopix 3.3 and now the command
sshstart works fine in textmode.
I run in textmode, because I do not need al the overhead. The PC is just an FTP server.

Because I want to configure my firewall as well, I would like to know which port is used by SSHD.

etierjr
11-07-2003, 01:46 PM
I did an upgrade to Knoopix 3.3 and now the command
sshstart works fine in textmode.
I run in textmode, because I do not need al the overhead. The PC is just an FTP server.

Because I want to configure my firewall as well, I would like to know which port is used by SSHD.

I'm glad you got it working!
I believe the default for ssh is port 22

Hope this helps

easement
12-19-2003, 03:28 PM
hey everyone, i have gotten my ftp up and running just fine thanks to all of you.....but one question....i have my hard drive mounted but how do i get to it from the ftp?

all i can see the ramdrive


thanks



I am having the same problem (I am able to connect to the FTP server, but can only see ramdrive). I want to see hda2 (type NTFS) to download files.

I tried ln -n /dev/hda /olddrive

I got an error. I also tried ln -n /mnt/hda /olddrive

Both of these commads were issued in /ramdisk/home/knoppix/

Anyone care to helpout?

ihavenotahotmail.com
12-21-2005, 01:58 AM
Maybe " mount -t ntfs /dev/hda2 /home/knoppix/tmp" and then go to /home/knoppix/tmp