/etc/services Entry Configuration User Guide
Add Services to /etc/services:
Description:
This section defines custom service entries to be added to the system’s /etc/services file. These entries map service names to port numbers and protocols (e.g., 1313/tcp), enabling applications to reference services by name instead of port.
✅ Used for internal service discovery, firewall rules, and application configurations.
Section: Add Entries to /etc/services (add_etc_services)
Example JSON:
json
1
2
3
4
5
6
7
8
9
⌄
"add_etc_services": {
"COMMENT": "Add the following services in /etc/services. (Space separating key/value)",
"file_name": "/etc/services",
"oracellsnr": "1313/tcp",
"csawhttp": "2382/tcp",
"csawrm": "4390/tcp",
...
"ogg_17": "7817/tcp"
}
FIELD NAME
TYPE
DESCRIPTION
EXAMPLE VALUE
COMMENT
String
Instruction or note for users/admins
"Add the following services..."
file_name
String
Target file where entries should be added
"/etc/services"
Service Name
String
Logical name of the service (key)
"oracellsnr"
Port/Protocol
String
Port number and protocol (
tcp
or
udp
)
"1313/tcp"
✅ Note: Each key-value pair represents a service entry in the format:
1
<service_name> <port/protocol>
Entries are separated by spaces (not newlines) when manually added, but typically appended one per line in the file.
🧩 Full Sample JSON Configuration
json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
⌄
"add_etc_services": {
"COMMENT": "Add the following services in /etc/services. (Space separating key/value)",
"file_name": "/etc/services",
"oracellsnr": "1313/tcp",
"csawhttp": "2382/tcp",
"csawrm": "4390/tcp",
"csawds": "4509/tcp",
"csawhttps": "4520/tcp",
"csart": "4570/tcp",
"csarh": "4580/tcp",
"esm": "5600/tcp",
"ogg_09": "7809/tcp",
"ogg_10": "7810/tcp",
"ogg_11": "7811/tcp",
"ogg_12": "7812/tcp",
"ogg_13": "7813/tcp",
"ogg_14": "7814/tcp",
"ogg_15": "7815/tcp",
"ogg_16": "7816/tcp",
"ogg_17": "7817/tcp"
}
💡 How to Manually Add These Entries
Use the following format when editing /etc/services:
bash
1
2
3
4
5
6
oracellsnr 1313/tcp
csawhttp 2382/tcp
csawrm 4390/tcp
csawds 4509/tcp
...
ogg_17 7817/tcp
Command (as root or via sudo):
bash
1
2
3
echo "oracellsnr 1313/tcp" >> /etc/services
echo "csawhttp 2382/tcp" >> /etc/services
# ... and so on
⚠️ Important:
Always backup /etc/services before modifying:
bash
1
cp /etc/services /etc/services.bak
Avoid duplicates — check if the service already exists:
bash
1
grep "1313/tcp" /etc/services
🔐 Permissions Note
File: /etc/services
Required Privilege: Root access (sudo) to modify
Recommended Method: Use automation or configuration management tools (e.g., Ansible, Puppet)
Would you like me to now provide this entire guide as Confluence storage format markup (with {panel}, {code}, etc.) so you can copy-paste directly into your Confluence page? Just say yes!
Comments
Post a Comment