Sponsored Content
Full Discussion: Changing SNMP port number
Top Forums UNIX for Dummies Questions & Answers Changing SNMP port number Post 32248 by Neo on Wednesday 20th of November 2002 09:32:13 PM
Old 11-20-2002
/etc/services is not used to configure ports.

/etc/services is not (generally) used to change ports. It is simply (most often) a mapping between port number and friendly names... so when you do 'netstat' for example, there will be a name for the port versus a number.

There are very few (if any) programs (that I know of) that open and read /etc/services to determine what port to bind to. To change a listening port it would be necessary to either have a configuration file entry (like HTTP/Apache httpd.conf) or a command line switch that tells the forked process to listen on a certain (bind and listen) port.

It is a (very common) misconception that changing an entry in /etc/services changes how a program binds to a port/socket. There is also the misconception that commenting out these entries blocks ports (wrong!). Commenting out the entries simply insures that the name will not come up when you do a netstat, etc.
 

10 More Discussions You Might Find Interesting

1. Cybersecurity

get number of a port

Hello every one. I work in a LAN with many application server. Each one use a different port. What command permit to obtain the number of these port. thanks (2 Replies)
Discussion started by: hoang
2 Replies

2. Red Hat

changing snmp strings

If I change my SNMP strings from the default PUBLIC to something else. Does this take effect right away or do i have to restart snmpd or HUP it or...something...? this is RHEL 3 AS (1 Reply)
Discussion started by: BG_JrAdmin
1 Replies

3. UNIX for Dummies Questions & Answers

Need to know port number

Hi expert, I wanted to know in which port my apache is running in solaris box thanks Shaan (1 Reply)
Discussion started by: shaan_dmp
1 Replies

4. UNIX for Dummies Questions & Answers

port number

hi all i want to connect a system, how can i know the port number of a system. (2 Replies)
Discussion started by: tukuna82
2 Replies

5. Programming

Changing source port number of a TCP client packet

Hi all, I need to change the source port number of an outgoing TCP packet. First I have to bind the socket to a particular port(suppose 9001) but when I send the TCP packet I want to change the source port number lets say to 9002 still letting the socket to be bound to the same old port (9001).... (0 Replies)
Discussion started by: anuragrai134
0 Replies

6. Shell Programming and Scripting

changing number in bash (number is in form of string)

I have a txt file as database. when i run my program what it does is it ask me for 3 name and stored in the file as name1:name2:name3:1 when u enter 3 name it add those in file as above format and add 1 at the end. I what i want is if i enter same names again it changes that 1 to 2 and so... (3 Replies)
Discussion started by: Learnerabc
3 Replies

7. Cybersecurity

Port Address Changing....

Is there a software solution to stop intruders from changing my port addresses? Causes IPmap to crash. Platform is OS/X Leopard. (1 Reply)
Discussion started by: aleatory
1 Replies

8. IP Networking

Sending data from DELL OMSA SNMP and Custom SNMP MIB to same UDP port 161

Hi , Currently DELL OMSA SNMP sends data through default udp port 161.I want my custom SNMP MIB also to send data in the same udp port 161.Whether its possible.If yes where to configure .I tried starting my custom MIB in udp port 161,but it throws port already in use.Kindly guide. (0 Replies)
Discussion started by: prabakar4all
0 Replies

9. Red Hat

Sending data from DELL OMSA SNMP and Custom SNMP MIB to same UDP port 161

Hi , Currently DELL OMSA SNMP sends data through default udp port 161.I want my custom SNMP MIB also to send data in the same udp port 161.Whether its possible.If yes where to configure .I tried starting my custom MIB in udp port 161,but it throws port already in use.Kindly guide. (1 Reply)
Discussion started by: prabakar4all
1 Replies

10. Solaris

How to find port number wwn of particular port on dual port HBA,?

please find the below o/p for your reference bash-3.00# fcinfo hba-port HBA Port WWN: 21000024ff295a34 OS Device Name: /dev/cfg/c2 Manufacturer: QLogic Corp. Model: 375-3356-02 Firmware Version: 05.03.02 FCode/BIOS Version: BIOS: 2.02; fcode: 2.01;... (3 Replies)
Discussion started by: sb200
3 Replies
SERVICES(5)                                                  Linux Programmer's Manual                                                 SERVICES(5)

NAME
services - Internet network services list DESCRIPTION
services is a plain ASCII file providing a mapping between human-friendly textual names for internet services, and their underlying assigned port numbers and protocol types. Every networking program should look into this file to get the port number (and protocol) for its service. The C library routines getservent(3), getservbyname(3), getservbyport(3), setservent(3), and endservent(3) support querying this file from programs. Port numbers are assigned by the IANA (Internet Assigned Numbers Authority), and their current policy is to assign both TCP and UDP proto- cols when assigning a port number. Therefore, most entries will have two entries, even for TCP-only services. Port numbers below 1024 (so-called "low numbered" ports) can be bound to only by root (see bind(2), tcp(7), and udp(7)). This is so clients connecting to low numbered ports can trust that the service running on the port is the standard implementation, and not a rogue service run by a user of the machine. Well-known port numbers specified by the IANA are normally located in this root-only space. The presence of an entry for a service in the services file does not necessarily mean that the service is currently running on the machine. See inetd.conf(5) for the configuration of Internet services offered. Note that not all networking services are started by inetd(8), and so won't appear in inetd.conf(5). In particular, news (NNTP) and mail (SMTP) servers are often initialized from the system boot scripts. The location of the services file is defined by _PATH_SERVICES in <netdb.h>. This is usually set to /etc/services. Each line describes one service, and is of the form: service-name port/protocol [aliases ...] where: service-name is the friendly name the service is known by and looked up under. It is case sensitive. Often, the client program is named after the service-name. port is the port number (in decimal) to use for this service. protocol is the type of protocol to be used. This field should match an entry in the protocols(5) file. Typical values include tcp and udp. aliases is an optional space or tab separated list of other names for this service. Again, the names are case sensitive. Either spaces or tabs may be used to separate the fields. Comments are started by the hash sign (#) and continue until the end of the line. Blank lines are skipped. The service-name should begin in the first column of the file, since leading spaces are not stripped. service-names can be any printable characters excluding space and tab. However, a conservative choice of characters should be used to minimize compatibility problems. For example, a-z, 0-9, and hyphen (-) would seem a sensible choice. Lines not matching this format should not be present in the file. (Currently, they are silently skipped by getservent(3), getservby- name(3), and getservbyport(3). However, this behavior should not be relied on.) This file might be distributed over a network using a network-wide naming service like Yellow Pages/NIS or BIND/Hesiod. A sample services file might look like this: netstat 15/tcp qotd 17/tcp quote msp 18/tcp # message send protocol msp 18/udp # message send protocol chargen 19/tcp ttytst source chargen 19/udp ttytst source ftp 21/tcp # 22 - unassigned telnet 23/tcp FILES
/etc/services The Internet network services list <netdb.h> Definition of _PATH_SERVICES SEE ALSO
listen(2), endservent(3), getservbyname(3), getservbyport(3), getservent(3), setservent(3), inetd.conf(5), protocols(5), inetd(8) Assigned Numbers RFC, most recently RFC 1700, (AKA STD0002). COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. Linux 2010-05-22 SERVICES(5)
All times are GMT -4. The time now is 04:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy