Sponsored Content
Full Discussion: clean /etc/hosts
Top Forums Shell Programming and Scripting clean /etc/hosts Post 302095397 by sysgate on Monday 6th of November 2006 05:03:54 PM
Old 11-06-2006
so, there are ways to do this in perl ( open the file for writing ) and replace the respective strings using regexp.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

hosts.allow & hosts.deny

Hi! Im trying to use host.allow & host.deny to resrtic access to my sun machine, but it doesnt seem to work... I want to allow full access from certain IPīs (ssh,http,ftp,etc...) but deny all kind of conections from outsideworld, the way that im doing that is: hosts.allow ALL:127.0.0.1... (2 Replies)
Discussion started by: Sorrento
2 Replies

2. UNIX for Advanced & Expert Users

Clean File

BeginDate 07/01/06 End: 07/31/06 Cust: A02991 - Burnham 0002000 5,829,773 145.3 0009701 4,043,850 267.3 2005000 286,785.13 100.0 BeginDate 07/01/06 End: 07/31/06 Cust: A01239 - East Track PSE Index A 0009902 317,356.82 890.2 0020021 ... (5 Replies)
Discussion started by: kris01752
5 Replies

3. UNIX for Dummies Questions & Answers

Hosts.allow and hosts.deny

Hello everyone, This is my first posts and I did search for a questions but did not find a question that answered my question unless of course I overlooked it. I'm running Solaris 8. I use ssh for the users but I have a user called "chatterbox" that uses telnet but I need for chatterbox to... (1 Reply)
Discussion started by: huddlestonsnk
1 Replies

4. UNIX for Dummies Questions & Answers

Help me clean this up

UNIX amature/novice. I've written a script (it works) that needs to be cleaned up. I'm searching for a way to perform a "go to , perform this then return" section of code. The books I have and searches i"ve done so far do not show me how to do this. I've pasted in the current code below. I've... (1 Reply)
Discussion started by: scanner248
1 Replies

5. AIX

How to clean PV id?

When I run command: >chdev -l hdisk1 -a pv=clear It shows Method error (/etc/methods/chgdisk): 0514-062 Cannot perform the requested function because the specified device is busy. run: #>fuser -kxuc /dev/raw1 /dev/raw1: How to clean PV id? (4 Replies)
Discussion started by: rainbow_bean
4 Replies

6. Shell Programming and Scripting

How to clean this script?

Hello guys, this script partially works but it's still pretty ugly and, moreover, if the month is jan/feb/mar... it doesn't work at all. Could anyone say me how to correct, cut and clean a little bit? #!/usr/bin/ksh egrep -v -e "^\s*#" /file/permission | awk '{ print $1 }' | sort | uniq... (3 Replies)
Discussion started by: gogol_bordello
3 Replies

7. Shell Programming and Scripting

Clean up the space

Hi I just want to clean up the space in UNIX. Is there any special command that does this process or do I need to manually type the following rm <filename> Any help would be really appreciated. Thanks (2 Replies)
Discussion started by: bobby1015
2 Replies

8. AIX

aix tcp wrappers hosts.allow hosts.deny?

hi all just installed the netsec.options.tcpwrapper from expansion pack, which used to be a rpm, for my aix 6.1 test box. it is so unpredictable. i set up the hosts.deny as suggested for all and allow the sshd for specific ip addresses/hostnames. the tcpdchk says the hosts allowed and... (0 Replies)
Discussion started by: wf201626
0 Replies

9. Solaris

How to copy a tar file on a series of remote hosts and untar it on those hosts?

Am trying to copy a tar file onto a series of remote hosts and untar it at the destination. Need to do this without having to do multiple ssh. Actions to perform within a single ssh session via shell script - copy a file - untar at destination (remote host) OS : Linux RHEL6 (3 Replies)
Discussion started by: sankasu
3 Replies
netgroup(4)							   File Formats 						       netgroup(4)

NAME
netgroup - list of network groups SYNOPSIS
/etc/netgroup DESCRIPTION
A netgroup defines a network-wide group of hosts and users. Use a netgroup to restrict access to shared NFS filesystems and to restrict remote login and shell access. Network groups are stored in a network information services, such as LDAP, NIS, or NIS+, not in a local file. This manual page describes the format for a file that is used to supply input to a program such as ldapaddent(1M) for LDAP, makedbm(1M) for NIS, or nisaddent(1M) for NIS+. These programs build maps or tables used by their corresponding network information services. Each line of the file defines the name and membership of a network group. The line should have the format: groupname member... The items on a line can be separated by a combination of one or more spaces or tabs. The groupname is the name of the group being defined. This is followed by a list of members of the group. Each member is either another group name, all of whose members are to be included in the group being defined, or a triple of the form: (hostname,username,domainname) In each triple, any of the three fields hostname, username, and domainname, can be empty. An empty field signifies a wildcard that matches any value in that field. Thus: everything (,,this.domain) defines a group named "everything" for the domain "this.domain" to which every host and user belongs. The domainname field refers to the domain in which the triple is valid, not the domain containing the host or user. In fact, applications using netgroup generally do not check the domainname. Therefore, using (,,domain) is equivalent to (,,) You can also use netgroups to control NFS mount access (see share_nfs(1M)) and to control remote login and shell access (see hosts.equiv(4)). You can also use them to control local login access (see passwd(4), shadow(4), and compat in nsswitch.conf(4)). When used for these purposes, a host is considered a member of a netgroup if the netgroup contains any triple in which the hostname field matches the name of the host requesting access and the domainname field matches the domain of the host controlling access. Similarly, a user is considered a member of a netgroup if the netgroup contains any triple in which the username field matches the name of the user requesting access and the domainname field matches the domain of the host controlling access. Note that when netgroups are used to control NFS mount access, access is granted depending only on whether the requesting host is a member of the netgroup. Remote login and shell access can be controlled both on the basis of host and user membership in separate netgroups. FILES
/etc/netgroup Used by a network information service's utility to construct a map or table that contains netgroup information. For exam- ple, ldapaddent(1M) uses /etc/netgroup to construct an LDAP container. Note that the netgroup information must always be stored in a network information service, such as LDAP, NIS, or NIS+. The local file is only used to construct a map or table for the network information service. It is never consulted directly. SEE ALSO
NIS+(1), ldapaddent(1M), makedbm(1M), nisaddent(1M), share_nfs(1M), innetgr(3C), hosts(4), hosts.equiv(4), nsswitch.conf(4), passwd(4), shadow(4) NOTES
netgroup requires a network information service such as LDAP, NIS, or NIS+. Applications may make general membership tests using the innetgr() function. See innetgr(3C). Because the "-" character will not match any specific username or hostname, it is commonly used as a placeholder that will match only wild- carded membership queries. So, for example: onlyhosts (host1,-,our.domain) (host2,-,our.domain) onlyusers (-,john,our.domain) (-,linda,our.domain) effectively define netgroups containing only hosts and only users, respectively. Any other string that is guaranteed not to be a legal username or hostname will also suffice for this purpose. Use of placeholders will improve search performance. When a machine with multiple interfaces and multiple names is defined as a member of a netgroup, one must list all of the names. See hosts(4). A manageable way to do this is to define a netgroup containing all of the machine names. For example, for a host "gateway" that has names "gateway-subnet1" and "gateway-subnet2" one may define the netgroup: gateway (gateway-subnet1,,our.domain) (gateway-subnet2,,our.domain) and use this netgroup "gateway" whenever the host is to be included in another netgroup. SunOS 5.11 22 Jul 2004 netgroup(4)
All times are GMT -4. The time now is 11:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy