Enabling telnet and ftp in Linux

VeryLittleJ

Junior Member
Jul 14, 2000
16
0
0
I have a RedHat 6.2 system newly installed. This linux is connected to other two win98 computers through the linksys DSL router.

The 1st important problem is that other win98 cannot telnet to the linux, and the linux itself cannot telnet to itself either.
When I type this in linux "telnet localhost",
it says
"Trying 127.0.0.1....
Telnet: unable to connect to remote host: connection refused"

How do i enable the telnet and ftp so that the other win98 can telnet/ftp to my linux?

The 2nd problem is a minor issue. I use linuxconf to change my hostname to "vlj.myhome". Is it ok to put ".myhome" as my domain name? Will that make any difference to the other local win98 machines?

oh, the linux itself cannot recognize it own name "vlj". When i type "telnet vlj" or "telnet vlj.myhome" it says "unknown host". How can i fix it?

Thank you

VLJ
 

HigherGround

Golden Member
Jan 9, 2000
1,827
0
0
Your ftp and telnet daemons are not running (and are not activated on demand)...run linuxconf and enable both.

As far as the second issue check your hostname by running 'hostname' or 'tail /etc/hosts'
 

Damaged

Diamond Member
Oct 11, 1999
3,020
0
0
If you don't have Linuxconf (and I don't use that POS) then as root, fire up an editor (e.g. PICO, vi, etc) and edit /etc/inetd.conf. Make sure that the lines concerning telnet and ftp are NOT commented out. If they are, then uncomment them, then issue killall -1 inetd.

After you do that check your /etc/hosts.allow and /etc/hosts.deny files and make sure that your range is enabled in those files. If they're blank, don't worry about it for now, but you should do something with that in the future. Particularly regarding telnet, though ftp has it's issues as well.

Actually, if you want to telnet from your windows box by using names, then you should edit your C:\Windows\hosts.sam file to enable that. Then just save it as hosts instead of hosts.sam (.sam means sample here). The file is self explanatory. You'll see what I mean when you open it.
 

VeryLittleJ

Junior Member
Jul 14, 2000
16
0
0
HI,

I have checked the hostname.
When i type "hostname", it dispalys "vlj.myhome"
When i type 'tail /etc/hosts' , it displays
"127.0.0.1 localhost.localdomain localhost"
What should i do then?


About the 1st problem, i couldn't fix it yet. I am not very familiar to linux.
I tried to open up linuxconf, but i don't know where the telnet and ftp daemons enable/disable options are.
Are they under one of the followings:?
Config-- Networking
Users accounts
File systems
Miscellaneous service
boot mode
Control-- control panel
control files and systems
logs


I also tried Damaged's method, but the problem is that i couldn't find /etc/inetd.conf
I could find hosts.allow and hosts.deny, but there are only some commnets, so basically they are blank.

Please give me a little more help. Thank you.

 

Damaged

Diamond Member
Oct 11, 1999
3,020
0
0
cd to /etc, then ls to list the contents of the directory. It has to be in there.
 

HigherGround

Golden Member
Jan 9, 2000
1,827
0
0
Damaged to the rescue....thanks for clarifying a few things for both VeryLittleJ and myselef :) Anyhow, in linuxconf, the service control dialog is under Cotrol Tab->Control Service Activity. Scroll down to ftp and telnet and Enable both of them. Remeber you have yo be root to run linuxconf. Also remember ro activate the changes before You quit (linuxconf will ask You do do)
 

ssadams

Junior Member
Nov 3, 1999
7
0
0
your telenet and ftp daemons are started with the inetd file so open a text editor and remove the hash mark in front of both services.the file to edit is /etc/inetd.conf
 

Damaged

Diamond Member
Oct 11, 1999
3,020
0
0
ssadams,

I've already explained that. Plus, when you make a change you have to HUP the daemon to get it to re-read the config file so that the changes take place, which I've also already explained.
 

VeryLittleJ

Junior Member
Jul 14, 2000
16
0
0
Hi everybody,

Hopefully, my response won't surprise you. In /etc/ directory, there is no inetd.conf file. I could find a lot of other *.conf file, but inetd.conf. I also checked out the linuxconf > Cotrol Tab->Control Service Activity, there is no telnet and ftp either. what can i do right now? is it possible to create the inetd.conf by myself?

Oh, what about the hostname? My linux still cannot recognize its name "vlj.myhome".

Thank you very much.

 

VeryLittleJ

Junior Member
Jul 14, 2000
16
0
0
me again,

I found this file. Although i am not sure if this file affects my system's configuration, i just wrote down what i see.

This file contains the followings:
/etc/inittab

# inittab This file describes how the INIT process should set up
# the system in a certain run-level.

# Author: Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
# Modified for RHS Linux by Marc Ewing and Donnie Barnes

# Default runlevel. The runlevels used by RHS are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)

id:5:initdefault:

# System initialization.
si::sysinit:/etc/rc.d/rc.sysinit

l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6

# Things to run in every runlevel.
ud::eek:nce:/sbin/update

# Trap CTRL-ALT-DELETE
ca::ctrlaltdel:/sbin/shutdown -t3 -r now

# When our UPS tells us power has failed, assume we have a few minutes
# of power left. Schedule a shutdown for 2 minutes from now.
# This does, of course, assume you have powerd installed and your
# UPS connected and working correctly.
pf::powerfail:/sbin/shutdown -f -h +2 &quot;Power Failure; System Shutting Down&quot; # If power was restored before the shutdown kicked in, cancel it.
pr:12345:powerokwait:/sbin/shutdown -c &quot;Power Restored; Shutdown Cancelled&quot;


# Run gettys in standard runlevels
1:2345:respawn:/sbin/mingetty tty1
2:2345:respawn:/sbin/mingetty tty2
3:2345:respawn:/sbin/mingetty tty3
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6

# Run xdm in runlevel 5
# xdm is now a separate service
x:5:respawn:/etc/X11/prefdm -nodaemon





-----------------------------------
end of file.
The last command makes me think this file could affect my system.

Thank you for your patience.
 

VeryLittleJ

Junior Member
Jul 14, 2000
16
0
0
:a :b :c :D :e :f :g :h :i :j
:k :l :m :n :eek: :p :Q :r :s :t
:u :v :w :x :y :z

haha.....funny...
some codes of that file has ':' + 'character', and they become faces.
hope you can match those faces back to english character.
 

LNXman

Senior member
Jul 27, 2000
404
0
0
That file is your system startup file (Do not play with it if you do not know what you are doing. But if you do because you want to learn, then make a boot disk first, make a back up of the file, and then play away)

Back to your problem. It seems that your Redhat install failed to add your inetd.conf file. That is not good. . .The file you are looking for, should look something like this:

# See &quot;man 8 inetd&quot; for more information.
#
# If you make changes to this file, either reboot your machine or send the
# inetd a HUP signal:
# Do a &quot;ps x&quot; as root and look up the pid of inetd. Then do a
# &quot;kill -HUP <pid of inetd>&quot;.
# The inetd will re-read this file whenever it gets that signal.
#
# <service_name> <sock_type> <proto> <flags> <user> <server_path> <args>
#
# The first 4 services are really only used for debugging purposes, so
# we comment them out since they can otherwise be used for some nasty
# denial-of-service attacks. If you need them, uncomment them.
# echo stream tcp nowait root internal
# echo dgram udp wait root internal
# discard stream tcp nowait root internal
# discard dgram udp wait root internal
# daytime stream tcp nowait root internal
# daytime dgram udp wait root internal
# chargen stream tcp nowait root internal
# chargen dgram udp wait root internal
#time stream tcp nowait root internal
#time dgram udp wait root internal
#
# These are standard services.
#
ftp stream tcp nowait root /usr/sbin/tcpd wu.ftpd -l -i -a
#telnet stream tcp nowait root /usr/sbin/tcpd in.telnetd
#
# Use this one instead if you want to snoop on telnet users (try to use this
# for ethical purposes, ok folks?), and see 'man ttysnoop' and /etc/snooptab
# for further instructions:
# telnet stream tcp nowait root /usr/sbin/tcpd in.telnetsnoopd
#
# This is for BSD sendmail. NOTE: It's not a good idea to uncomment this
# one, since sendmail is already set up to run as a daemon in /etc/rc.d/rc.M.
# But, if you really want to run sendmail this way for some reason, you'll
# need to uncomment the smtp line below AND change the line in /etc/rc.d/rc.M
# to run sendmail like this: /usr/sbin/sendmail -q30m
# ...otherwise the queue will not be processed.
# smtp stream tcp nowait root /usr/sbin/tcpd sendmail -bs
#
# The comsat daemon notifies the user of new mail when biff is set to y:
comsat dgram udp wait root /usr/sbin/tcpd in.comsat
#
# Shell, login, exec and talk are BSD protocols.
#
#shell stream tcp nowait root /usr/sbin/tcpd in.rshd -L
login stream tcp nowait root /usr/sbin/tcpd in.rlogind
# exec stream tcp nowait root /usr/sbin/tcpd in.rexecd
# talk dgram udp #
# klogin stream tcp nowait root /usr/sbin/tcpd rlogind -k
# eklogin stream tcp nowait root /usr/sbin/tcpd rlogind -k -x
# kshell stream tcp nowait root /usr/sbin/tcpd rshd

. . . etc

If you do not have this file, then mostlikely your installation CD needs cleaning or has a scratch in it. You should try and re-install if possible (and watch the progress bars to make sure they fill up smoothly),try to create a new inetd.conf file from scratch, or get another CD. Be aware, however, that many other files might not have been installed as well if the CD was in fact scratched. Did you check out the Red Hat home page (http://www.redhat.com/apps/support/updates.html) for any errata? Maybe that is a known problem. . .

Good luck,

:)
 

Michael

Elite member
Nov 19, 1999
5,435
234
106
If you intalled the GNOME of KDE workstation version of RedHat 6.2, inetd is NOT installed by default. You can telnet and FTP out but not into the box. Someone at RedHat decided that Workstations shouldn't have to worry quite so much about security and that best solution was to not install inetd.

You'll need to install the RPM's from your source disk and then get the setting right via Linuxconfig.

Michael
 

VeryLittleJ

Junior Member
Jul 14, 2000
16
0
0
Thanks everybody, especially Michael.
I am exactly installing KDE workstation version of RedHat 6.2,
and that's why inetd.conf is not there as you said.

I am a beginner of Linux system, so could you explain a little more how to install the RPM's from the source disk?

Thanks again.

VLJ
 

Damaged

Diamond Member
Oct 11, 1999
3,020
0
0
Look for something under the RPMS directory called inetd. You can just do an ls inetd* and if the binary is there it will list it.

Then, as root, rpm -ivh inetd<blah>.foo.rpm to install it. Watch what happens because it may not install and you may have to install other packages to satisfy dependencies.
 

VeryLittleJ

Junior Member
Jul 14, 2000
16
0
0
Hi,

I successfully install &quot;inetd&quot; from the CD. However, it still has problem.

When i telnet to myself:


[root@localhost /root]# telnet localhost
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.

(i waited for about 10 seconds)
Connection closed by foreign host.

What should i do now?
Also, what is the correct way to change the hostname (localhost.localdomain)? I tried to change it in linuxconf, but it cannot recognize it.

Thanks a lot

VLJ
 

andri

Senior member
Aug 12, 2000
339
0
0
Look in the msglog (/var/log/messages). Inetd will complain there, but I guess that Telnet server (in.telnetd) is missing, and probably is in telnet-server or similar package.

Why telnet anyway? Insecure. I'd say go for SSH - Secure SHell (like telnet, but traffic is encrypted).

Just my $0.02
 

VeryLittleJ

Junior Member
Jul 14, 2000
16
0
0
:)

I can finally telnet and ftp from the other two win98. After i installed the &quot;telnet-server&quot;and &quot;wu-ftpd&quot; package from the source CD, both telnet and ftp work fine now.
Thank you everybody. :)

The reason why i use telnet and ftp is that i usually use them in local network, and i have a linksys DSL router as a firewall to block the WAN. So, i think telnet is good enough. Thanks again.

By the way, if anyone knows how to change the hostname (by default, it is &quot;localhost.localdomain&quot;) with DHCP enabled, please let me know.

Thank you very much

VLJ
 

Michael

Elite member
Nov 19, 1999
5,435
234
106
VeryLittleJ - I had the exact same problem as you and it took me a day or so of searching the internet to find out why I was having the problem. Glad I could help. I wish that Redhat would ask you if not installing inetd and the telnet/ftp servers is what you want to do. They really do not document that &quot;feature&quot; of the workstation install.

Michael
 

HigherGround

Golden Member
Jan 9, 2000
1,827
0
0
this is exactly why you should always (unless you are a complete newbie) do an expert install ( which asks you to individually slecet and deselct the packages ) That way you end up with a nicely configured system with packages you really want ad need :)
 

Michael

Elite member
Nov 19, 1999
5,435
234
106
The problem with &quot;expert mode&quot; is not selecting what packages to load. The problem is setting up the file system as well. So you have to know a decent amount about Linux from the beginning. The preset instalations set up the filesytem for you as well.

Michael