LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-02-2009, 06:46 AM   #1
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,461
Blog Entries: 6

Rep: Reputation: 51
How to Enable telnet?


I have Fedora 9 running as Sendmail Server. I tried to telnet from client machine but reported error like:

Server : 10.14.73.50
Client: 10.14.77.33

FROM CLIENT MACHINE:

Code:
[root@bl ~]# telnet 10.14.73.50 25
Trying 10.14.73.50...
telnet: connect to address 10.14.73.50: Connection refused
telnet: Unable to connect to remote host: Connection refused
FROM SERVER MACHINE:

I tried running :
Code:
[root@Innova ~]# nmap -vv localhost

Starting Nmap 4.53 ( http://insecure.org ) at 2009-10-02 21:39 IST
Initiating SYN Stealth Scan at 21:39
Scanning localhost.localdomain (127.0.0.1) [1714 ports]
Discovered open port 443/tcp on 127.0.0.1
Discovered open port 22/tcp on 127.0.0.1
Discovered open port 80/tcp on 127.0.0.1
Discovered open port 25/tcp on 127.0.0.1
Discovered open port 3306/tcp on 127.0.0.1
Discovered open port 7070/tcp on 127.0.0.1
Discovered open port 139/tcp on 127.0.0.1
Discovered open port 631/tcp on 127.0.0.1
Discovered open port 111/tcp on 127.0.0.1
Discovered open port 445/tcp on 127.0.0.1
Discovered open port 9090/tcp on 127.0.0.1
Completed SYN Stealth Scan at 21:39, 0.09s elapsed (1714 total ports)
Host localhost.localdomain (127.0.0.1) appears to be up ... good.
Interesting ports on localhost.localdomain (127.0.0.1):
Not shown: 1703 closed ports
PORT     STATE SERVICE
22/tcp   open  ssh
25/tcp   open  smtp
80/tcp   open  http
111/tcp  open  rpcbind
139/tcp  open  netbios-ssn
443/tcp  open  https
445/tcp  open  microsoft-ds
631/tcp  open  ipp
3306/tcp open  mysql
7070/tcp open  realserver
9090/tcp open  zeus-admin

Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 0.130 seconds
           Raw packets sent: 1714 (75.416KB) | Rcvd: 3439 (144.460KB)
You have new mail in /var/spool/mail/root
[root@Innova ~]# service telnet restart
telnet: unrecognized service
[root@Innovation1 ~]# rpm -qa telnet
telnet-0.17-42.fc9.i386
[root@Innova ~]#
I dont see Port 23 Open.
That means telnet is not enabled. How Can I enable telnet in my Fedora 9 Box?

Last edited by your_shadow03; 10-02-2009 at 06:48 AM.
 
Old 10-02-2009, 06:57 AM   #2
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by your_shadow03 View Post
I have Fedora 9 running as Sendmail Server. I tried to telnet from client machine but reported error like:
Code:
[root@bl ~]# telnet 10.14.73.50 25
Trying 10.14.73.50...
telnet: connect to address 10.14.73.50: Connection refused
telnet: Unable to connect to remote host: Connection refused
I tried running :
Code:
[root@Innova ~]# nmap -vv localhost

Starting Nmap 4.53 ( http://insecure.org ) at 2009-10-02 21:39 IST
Initiating SYN Stealth Scan at 21:39
Scanning localhost.localdomain (127.0.0.1) [1714 ports]
Discovered open port 443/tcp on 127.0.0.1
Discovered open port 22/tcp on 127.0.0.1
Discovered open port 80/tcp on 127.0.0.1
Discovered open port 25/tcp on 127.0.0.1
Discovered open port 3306/tcp on 127.0.0.1
Discovered open port 7070/tcp on 127.0.0.1
Discovered open port 139/tcp on 127.0.0.1
Discovered open port 631/tcp on 127.0.0.1
Discovered open port 111/tcp on 127.0.0.1
Discovered open port 445/tcp on 127.0.0.1
Discovered open port 9090/tcp on 127.0.0.1
Completed SYN Stealth Scan at 21:39, 0.09s elapsed (1714 total ports)
Host localhost.localdomain (127.0.0.1) appears to be up ... good.
Interesting ports on localhost.localdomain (127.0.0.1):
Not shown: 1703 closed ports
PORT     STATE SERVICE
22/tcp   open  ssh
25/tcp   open  smtp
80/tcp   open  http
111/tcp  open  rpcbind
139/tcp  open  netbios-ssn
443/tcp  open  https
445/tcp  open  microsoft-ds
631/tcp  open  ipp
3306/tcp open  mysql
7070/tcp open  realserver
9090/tcp open  zeus-admin

Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 0.130 seconds
           Raw packets sent: 1714 (75.416KB) | Rcvd: 3439 (144.460KB)
You have new mail in /var/spool/mail/root
[root@Innova ~]# service telnet restart
telnet: unrecognized service
[root@Innovation1 ~]# rpm -qa telnet
telnet-0.17-42.fc9.i386
[root@Innova ~]#
That means telnet is not enabled. How Can I enable telnet in my Fedora 9 Box?
1. Install the telnet server:

Code:
# yum install telnet-server
2. Enable it:

Code:
# chkconfig telnet on
# service xinetd restart
But ... you really don't want to use telnet for anything serious. Use SSH instead, for anything but intranet fun & games.
 
Old 10-02-2009, 09:39 AM   #3
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,461
Blog Entries: 6

Original Poster
Rep: Reputation: 51
I am using telnet for checking sendmail connectivity.
Do You have other way around apart from this?
 
Old 10-02-2009, 10:16 AM   #4
Tux-Slack
Member
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware 13.37
Posts: 511

Rep: Reputation: 37
You don't need a telnet server for this. You already have the client and that's it.
You're trying to connect to it too.
telnet IP PORT(25 is sendmail/SMTP)
But your connection gets refused by sendmail for some reason, not because you don't have telnet server installed.

When you run nmap, run it as:
nmap -p 25 10.14.73.50
not localhost, nmap the same IP as you're trying to connect to SMTP.

Last edited by Tux-Slack; 10-02-2009 at 10:19 AM.
 
Old 10-02-2009, 12:39 PM   #5
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,461
Blog Entries: 6

Original Poster
Rep: Reputation: 51
Thanks Tux-Slack !!!

I tried running from client:

Code:
[root@bl ~]# nmap -p 25 10.14.73.50

Starting nmap 3.70 ( http://www.insecure.org/nmap/ ) at 2009-10-02 16:55 IST
Interesting ports on 10.14.73.50:
PORT   STATE  SERVICE
25/tcp closed smtp

Nmap run completed -- 1 IP address (1 host up) scanned in 0.308 seconds
What could be the reason?
Whenever I send mail through sendmail as:
#echo "hello" | mail -v -s "hi" tuxbuddy@gmail.com

It works !!!

But Why Dont client recognize the server.

Last edited by your_shadow03; 10-02-2009 at 12:44 PM.
 
Old 10-02-2009, 01:18 PM   #6
Tux-Slack
Member
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware 13.37
Posts: 511

Rep: Reputation: 37
Because that way it tries to send mail over localhost and it works.
I bet your sendmail is listening only on 127.0.0.1
Paste output of command:
netstat -avtpn | grep 25
And your sendmail.mc file.

Or wait, just look for a line similar to:
DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')dnl
in your sendmail.mc file.
Addr=0.0.0.0 means that the server will listen on all machines network interfaces.
If you want to send mail over your server only from your internal network then change Addr=0.0.0.0 to:
Addr=Servers-Internal-IP
I think it's this one 10.14.73.50 right?
But if you want to send mail over your mail server from outside of your network then leave it 0.0.0.0, but in that case be double sure you're not an open relay.
You can test it with some of these tools
And make sure that your firewall(iptables) allows traffic over TCP port 25 on local and/or public network.

Last edited by Tux-Slack; 10-02-2009 at 01:26 PM.
 
Old 10-02-2009, 01:45 PM   #7
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,461
Blog Entries: 6

Original Poster
Rep: Reputation: 51
Here is the output:
Code:
[root@Innova ~]# netstat -avtpn | grep 25
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      25513/mysqld
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      2586/sendmail: acce
tcp        0      0 ::ffff:127.0.0.1:41982      ::ffff:127.0.0.1:25         TIME_WAIT   -
You have new mail in /var/spool/mail/root
Now I have added as you said and now the output becomes:

Code:
[root@Innovation1 mail]# netstat -avtpn | grep 25                               tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      25513/mysqld
tcp        0      0 10.14.73.50:25              0.0.0.0:*                   LISTEN      4198/sendmail: acce

Last edited by your_shadow03; 10-02-2009 at 01:54 PM.
 
Old 10-02-2009, 01:47 PM   #8
Tux-Slack
Member
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware 13.37
Posts: 511

Rep: Reputation: 37
Are you sure you ran that on the mail server?
 
Old 10-02-2009, 01:55 PM   #9
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,461
Blog Entries: 6

Original Poster
Rep: Reputation: 51
Sorry I posted before refreshing.

Now Its Working !!!
Thanks Tux.

Now it shows:
Code:
[root@bl mail]# telnet 10.14.73.50 25
Trying 10.14.73.50...
Connected to 10.14.73.50 (10.14.73.50).
Escape character is '^]'.
220 Innova.intinfra.com ESMTP Sendmail 8.14.2/8.14.2; Sat, 3 Oct 2009 04:55:21 +0530

Last edited by your_shadow03; 10-02-2009 at 01:57 PM.
 
Old 10-02-2009, 01:59 PM   #10
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,461
Blog Entries: 6

Original Poster
Rep: Reputation: 51
One Last Query..

Say, Sitting on Client I want to send mail to a user called abhi on the Server.
How can I do that?
 
Old 10-02-2009, 02:02 PM   #11
Tux-Slack
Member
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware 13.37
Posts: 511

Rep: Reputation: 37
I forgot one thing tho. Sowwee.
Now sendmail wont listen on the localhost.
Minor fix. Just add another line reading:
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

Rebuild .mc file, restart sendmail and both should now work.


To send a mail through your server you need to configure a mail client application, such as thunderbird, add a outgoing SMTP server(your server local IP, port 25 and use proper authentication). Don't know exactly how to send mail with sendmail command from a client, never tried it.

Don't know exactly how your server is configured, but to get a little better idea, I suggest reading through Slackware SMTP AUTH HowTo. You can skip the installing part, because you've already got the MTA installed, and the configuration is pretty much the same deal on all systems running sendmail. It will give you a better insight on how sendmail or should I say, how any MTA works. If you wont understand anything, I will be more than happy, as I'm sure anyone else will be, to answer any possible questions regarding the configuration.

Last edited by Tux-Slack; 10-02-2009 at 02:10 PM.
 
Old 10-02-2009, 02:06 PM   #12
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,461
Blog Entries: 6

Original Poster
Rep: Reputation: 51
In one of the Other Server its not showing :

Code:
[root@Innovation2 ~]# netstat -avtpn | grep 25
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      32501/mysqld
tcp        0      0 0.0.0.0:47825               0.0.0.0:*                   LISTEN      -
tcp        0     52 10.14.16.215:22             158.234.236.194:2515        ESTABLISHED 25241/14
tcp        0      0 ::ffff:10.14.16.215:3690    ::ffff:10.14.2.254:1107     ESTABLISHED 12648/svnserve
tcp        0      0 ::ffff:10.14.16.215:3690    ::ffff:10.14.2.254:1103     ESTABLISHED 12645/svnserve
tcp        0      0 ::ffff:10.14.16.215:3690    ::ffff:10.14.227.25:1321    ESTABLISHED 7423/svnserve
tcp        0      0 ::ffff:10.14.16.215:3690    ::ffff:10.14.2.254:2181     ESTABLISHED 11561/svnserve
tcp        0      0 ::ffff:10.14.16.215:3690    ::ffff:10.14.2.254:1115     ESTABLISHED 12663/svnserve
tcp        0      0 ::ffff:10.14.16.215:3690    ::ffff:10.14.2.254:1318     ESTABLISHED 15225/svnserve
tcp        0      0 ::ffff:10.14.16.215:3690    ::ffff:10.14.2.254:1112     ESTABLISHED 12660/svnserve
tcp        0      0 ::ffff:10.14.16.215:3690    ::ffff:10.14.2.254:2656     ESTABLISHED 16527/svnserve
[root@Innovation2 ~]#

May I know why :25 is not shown by the netstat though I started sendmail manually
 
Old 10-02-2009, 02:09 PM   #13
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,461
Blog Entries: 6

Original Poster
Rep: Reputation: 51
Done.

Thanks Tux for Fix.
Code:
[root@Innova mail]# netstat -avtpn | grep 25
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      25513/mysqld
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      4330/sendmail: acce
tcp        0      0 10.14.73.50:25              0.0.0.0:*                   LISTEN      4330/sendmail: acce
tcp        0      0 ::ffff:127.0.0.1:48561      ::ffff:127.0.0.1:25         TIME_WAIT   -
 
Old 10-02-2009, 02:11 PM   #14
Tux-Slack
Member
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware 13.37
Posts: 511

Rep: Reputation: 37
Quote:
Originally Posted by your_shadow03 View Post
In one of the Other Server its not showing :

Code:
[root@Innovation2 ~]# netstat -avtpn | grep 25
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      32501/mysqld
tcp        0      0 0.0.0.0:47825               0.0.0.0:*                   LISTEN      -
tcp        0     52 10.14.16.215:22             158.234.236.194:2515        ESTABLISHED 25241/14
tcp        0      0 ::ffff:10.14.16.215:3690    ::ffff:10.14.2.254:1107     ESTABLISHED 12648/svnserve
tcp        0      0 ::ffff:10.14.16.215:3690    ::ffff:10.14.2.254:1103     ESTABLISHED 12645/svnserve
tcp        0      0 ::ffff:10.14.16.215:3690    ::ffff:10.14.227.25:1321    ESTABLISHED 7423/svnserve
tcp        0      0 ::ffff:10.14.16.215:3690    ::ffff:10.14.2.254:2181     ESTABLISHED 11561/svnserve
tcp        0      0 ::ffff:10.14.16.215:3690    ::ffff:10.14.2.254:1115     ESTABLISHED 12663/svnserve
tcp        0      0 ::ffff:10.14.16.215:3690    ::ffff:10.14.2.254:1318     ESTABLISHED 15225/svnserve
tcp        0      0 ::ffff:10.14.16.215:3690    ::ffff:10.14.2.254:1112     ESTABLISHED 12660/svnserve
tcp        0      0 ::ffff:10.14.16.215:3690    ::ffff:10.14.2.254:2656     ESTABLISHED 16527/svnserve
[root@Innovation2 ~]#

May I know why :25 is not shown by the netstat though I started sendmail manually
You can't check for listening ports with netstat over network, you need to use nmap to check open ports, but it can be a bloat, perhaps the daemon is listening for the "outside world" but the firewall might be blocking it, so it's always better to check on the server that's running the daemon for listen addresses and ports, because it doesn't matter how much the firewall is blocking it.
 
Old 10-02-2009, 02:16 PM   #15
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,461
Blog Entries: 6

Original Poster
Rep: Reputation: 51
I ran the nmap on Machine 10.14.16.215(new Server) and it showed:
Code:
[root@Innovation2 ~]# nmap -vv localhost

Starting Nmap 4.53 ( http://insecure.org ) at 2009-10-02 23:32 IST
Initiating SYN Stealth Scan at 23:32
Scanning localhost.localdomain (127.0.0.1) [1714 ports]
Discovered open port 22/tcp on 127.0.0.1
Discovered open port 80/tcp on 127.0.0.1
Discovered open port 443/tcp on 127.0.0.1
Discovered open port 139/tcp on 127.0.0.1
Discovered open port 977/tcp on 127.0.0.1
Discovered open port 3306/tcp on 127.0.0.1
Discovered open port 631/tcp on 127.0.0.1
Discovered open port 8080/tcp on 127.0.0.1
Discovered open port 2049/tcp on 127.0.0.1
Discovered open port 445/tcp on 127.0.0.1
Discovered open port 8009/tcp on 127.0.0.1
Discovered open port 111/tcp on 127.0.0.1
Completed SYN Stealth Scan at 23:32, 0.08s elapsed (1714 total ports)
Host localhost.localdomain (127.0.0.1) appears to be up ... good.
Interesting ports on localhost.localdomain (127.0.0.1):
Not shown: 1702 closed ports
PORT     STATE SERVICE
22/tcp   open  ssh
80/tcp   open  http
111/tcp  open  rpcbind
139/tcp  open  netbios-ssn
443/tcp  open  https
445/tcp  open  microsoft-ds
631/tcp  open  ipp
977/tcp  open  unknown
2049/tcp open  nfs
3306/tcp open  mysql
8009/tcp open  ajp13
8080/tcp open  http-proxy

Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 0.114 seconds
           Raw packets sent: 1714 (75.416KB) | Rcvd: 3440 (144.504KB)
[root@Innovation2 ~]#
No Idea why its Not showing :25.
I checked with these commands:
Code:
[root@Innovation2 ~]# service iptables status
iptables: Firewall is not running.
[root@Innovation2 ~]#
[root@Innovation2 ~]# setenforce 0
[root@Innovation2 ~]# nmap -vv localhost

Starting Nmap 4.53 ( http://insecure.org ) at 2009-10-02 23:36 IST
Initiating SYN Stealth Scan at 23:36
Scanning localhost.localdomain (127.0.0.1) [1714 ports]
Discovered open port 22/tcp on 127.0.0.1
Discovered open port 80/tcp on 127.0.0.1
Discovered open port 443/tcp on 127.0.0.1
Discovered open port 445/tcp on 127.0.0.1
Discovered open port 2049/tcp on 127.0.0.1
Discovered open port 3306/tcp on 127.0.0.1
Discovered open port 8009/tcp on 127.0.0.1
Discovered open port 111/tcp on 127.0.0.1
Discovered open port 139/tcp on 127.0.0.1
Discovered open port 631/tcp on 127.0.0.1
Discovered open port 8080/tcp on 127.0.0.1
Discovered open port 977/tcp on 127.0.0.1
Completed SYN Stealth Scan at 23:36, 0.08s elapsed (1714 total ports)
Host localhost.localdomain (127.0.0.1) appears to be up ... good.
Interesting ports on localhost.localdomain (127.0.0.1):
Not shown: 1702 closed ports
PORT     STATE SERVICE
22/tcp   open  ssh
80/tcp   open  http
111/tcp  open  rpcbind
139/tcp  open  netbios-ssn
443/tcp  open  https
445/tcp  open  microsoft-ds
631/tcp  open  ipp
977/tcp  open  unknown
2049/tcp open  nfs
3306/tcp open  mysql
8009/tcp open  ajp13
8080/tcp open  http-proxy

Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 0.113 seconds
           Raw packets sent: 1714 (75.416KB) | Rcvd: 3440 (144.504KB)
[root@Innovation2 ~]#

Last edited by your_shadow03; 10-02-2009 at 02:17 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
enable telnet mbquartnut SUSE / openSUSE 6 05-23-2008 11:35 PM
How to enable telnet muneebs123 Linux - Newbie 11 04-04-2008 06:01 AM
Enable Telnet mrurmil Fedora 4 02-13-2007 10:46 PM
enable telnet but can't telnet from the computer guanyu Linux - Networking 8 08-26-2002 07:34 AM
enable telnet on RH7.1 systray Linux - Newbie 1 03-22-2002 01:34 PM


All times are GMT -5. The time now is 10:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration