LinuxQuestions.org
Review your favorite Linux distribution.
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 08-18-2012, 08:46 AM   #1
singhjc
Member
 
Registered: Nov 2010
Location: Moradabad
Distribution: Redhat,Centos
Posts: 31

Rep: Reputation: 1
Wink command to know which port no is using by ssh or ftp or telnet service


hello all,



i have a question which was asked to me by an interviewer the question is that.



how to know which port is using by ssh or telnet service through command i couldn't get it answer this question that why i came here , i really thankful for your correct reply.
 
Old 08-18-2012, 09:32 AM   #2
camorri
LQ Guru
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 14.1, 14.2
Posts: 5,090

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
You can find out what "well know ports" are at this site.

-->http://www.networksorcery.com/enp/pr...ports00000.htm

That does not tell you what ports are in use on any particular system though. For that you need a port scanner. In linux, nmap will scan a system. nmap is a command line tool. There is a gui front end called zenmap, that makes it easier for a terminal challenged person.
 
Old 08-18-2012, 10:13 AM   #3
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
You could also grep the config files for the services in question to see if they're set up to listen on any non-standard ports.
 
Old 08-18-2012, 11:56 AM   #4
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 4,430

Rep: Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350
Perhaps 'netstat -atpn' if you are interested in the local system?
 
Old 08-19-2012, 08:11 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
A local on-machine list of the 'Well Known Ports' (& therefore defaults) is /etc/services
 
  


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
How to login to server even ssh & Telnet service down jayakumar01 Linux - Server 1 12-27-2011 02:02 PM
FTP/TELNET SERVER: Service not available/connection refused. What does it mean? svar Linux - Networking 6 12-15-2005 07:25 AM
Getting FTP, TELNET , or SSH to work jst1 SUSE / openSUSE 1 03-08-2005 09:54 PM
SuSE 9.2 - FTP Port open with no FTP service?!?! don_wombat Linux - Security 12 12-01-2004 04:14 PM
port 143. can't telnet, service enabled, no iptables. help? trossachs Linux - Networking 21 02-18-2004 06:48 PM


All times are GMT -5. The time now is 02:44 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