Tuesday, November 13, 2007

Daemons (NIS)

portmap

The foundation service for RPC

yppasswdd

Allows users to change their NIS passwords

ypserv

NIS server daemon

ypbind

NIS client daemon

ypxfrd

The NIS map transfer daemon

Monday, November 12, 2007

Daemons (NFS)

Server :
rpc.portmap
rpc.mountd, rpc.nfsd
rpc.statd, rpc.lockd (if necessary), and rpc.rquotad

Client:

rpc.lockd
rpc.statd

automount if using automounter.

Nfs lock problem

NFS PROBLEM:

while strating the nfslock service the output was

  1. service nfslock start

Starting NFS statd: statd: Could not chdir: No such file or directory [FAILED]


and dmesg shows something like this:-

lockd: cannot monitor 192.168.9.32 nsm_mon_unmon: rpc failed, status=-13

Solution:-

Follow the below mentioned steps to resolve the problem:-

  1. cd /var/lib/nfs
  2. mkdir statd
  3. chmod 700 statd
  4. touch state
  5. chmod 600 state
  6. service nfslock restart

Tar/Untar Simultaneously.

Here is a Nice Way to put all your data from one location to another in a fast way.
Traditionally a user woudl first tar his whole directory go to destination and the untar.
This takes more time and needs huge space.

Use the following command instead:

tar cf - "data to be tarred"|(cd destination; tar xf -)

There is a very simple concept behind this command:
The hyphon ( "-") in the command is stdout.
So basically the file in which we are tarring the data is streaming the tarred data to stdout (not saving it).
The '|' lets us parse the stream and tar xf - untars the stream at the place defined by cd destination command.

For doing it from a different machine just add rsh machine name in front of the command.

There are a few things which need to be kept in mind while doing these:

1. Never use v option of tar in this command.
Why: A very simple reason v throws the output of whatever is happening on STDOUT. the extraction part thinks that it is not a proper archive since it doesnt has the proper header and hence the command fails.

2. While using rsh remember that no extra rc(profile startup) files are there in the profile which give any output. the reason is the same.
Also remember that the rsh should be passwordless.

Monday, November 5, 2007

Local User password Changes

net user userid password.

Use this command in login scripts / or with for loop in batch scripts to change passwords on multiple machines.
for /f %%c in (comp.txt) do ashu.bat %%c
where comp.txt contains the names of the systems where changes need to be made.
ashu.bat contain the commands that need to be run to accomplish the changes.

Do remember any kind of loop commands which run remotely need to be run using Domain Local Admin accounts.