Tuesday, January 22, 2008

How to Deny users Telnet or FTP access.

vi /etc/inetd.conf

Comment the line starts with Telnet or
FTP. Save the file and exit.

Stop and start the inetd daemon now by
following commands:

/etc/rc2.d/S72inetsvc stop

/etc/rc2.d/S72inetsvc start

(Your flavor may be /etc/init.d)

or
send a hang-up (HUP) signal to the inetd process to force it to reread the configuration file:

# pkill -HUP inetd

From now on, no one can telnet or FTP to your
server from outside network.

How to change someones shell in NIS+

nistbladm -e shell=/bin/tcsh '[name=username]'passwd.org_dir

Find

The -exec extension to the find command is a very useful and
flexible utility.

You can use it to get a nice list of all the files in a directory
tree:

find . -type f -exec ll {} \;

or to copy all the files in a directory tree into one, large
directory:

find . -type f -exec cp -p {} /newdir \;

Or say now that you've copied all those files into one directory
there are too many .bak files to delete all at once with the 'rm'
command (yes, that's possible):

find . -name \*bak -exec rm {} \;

CHECKING FOR FILESYSTEMS THAT ARE FULL

Many times we have a file
systems which is too full.
To quickly find out which
are the file system
We could use:

df -k|awk '{if ( $4 >= 90 ) print $4," " $7 }'


Check the fields on your
flavor, it may not be $4 or $7.
Yours could be different.

basic subnetting

subnet 101

TCP/IP

0 - 255 = 256

4 -2
8-6
16 -14
32 - 30
64 - 62
128 - 126
256 - class C

example : I need 18 new IPs so:

256 - 32 = 224 since you have to round off to the next highest.

.224 will be the new subnet

therefore I have 30 available to use on the new 224 subnet. 32 + 30 = 62

.32 .33 .34 .35 .36 .37 .38 ....... .62