LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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, 07: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, 08:32 AM   #2
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 14.2, 15.0, current, slackware-arm-currnet
Posts: 6,061

Rep: Reputation: 806Reputation: 806Reputation: 806Reputation: 806Reputation: 806Reputation: 806Reputation: 806
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, 09:13 AM   #3
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2141Reputation: 2141Reputation: 2141Reputation: 2141Reputation: 2141Reputation: 2141Reputation: 2141Reputation: 2141Reputation: 2141Reputation: 2141Reputation: 2141
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, 10:56 AM   #4
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,167

Rep: Reputation: 2644Reputation: 2644Reputation: 2644Reputation: 2644Reputation: 2644Reputation: 2644Reputation: 2644Reputation: 2644Reputation: 2644Reputation: 2644Reputation: 2644
Perhaps 'netstat -atpn' if you are interested in the local system?
 
Old 08-19-2012, 07:11 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 18,236

Rep: Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710
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 01:02 PM
FTP/TELNET SERVER: Service not available/connection refused. What does it mean? svar Linux - Networking 6 12-15-2005 06:25 AM
Getting FTP, TELNET , or SSH to work jst1 SUSE / openSUSE 1 03-08-2005 08:54 PM
SuSE 9.2 - FTP Port open with no FTP service?!?! don_wombat Linux - Security 12 12-01-2004 03:14 PM
port 143. can't telnet, service enabled, no iptables. help? trossachs Linux - Networking 21 02-18-2004 05:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:08 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
Open Source Consulting | Domain Registration