Unix Administration
Tuesday, June 17, 2008
 

Create user profile and tips

1. Create a user using below command

useradd ram

2.To Set the password fir the

user passwd ram

3.To delete the user

userdel ram

3.To lock the account

usermod -L ram (or) passwd -l ram

4.To release the lock

usermod -U ram

5.To set a expiration date for the user

usermod -e 06/17/2008 ram

Some Tips

To disable an account:
/usr/lbin/modprpw -m alock=YES username

To enable a user account:
/usr/lbin/modprpw -k username

To check status of the account:
/usr/lbin/getprpw -r -m lockout username
It will return a 7 digit number and if the 6th digit is set to 1 that the account is locked

Blocking all the user account

If u want to block all the user for perticular box, Just create one empty file BLOBKALLBUT ROOT
It will be block the all the user and only root can access.

 
Wednesday, June 11, 2008
 
Sendamail Tips

Mail spool


Sendmail generally stores its queued mail in the var/spool/mqueue folder. Queued messages are messages that have not reached their final destination yet. There are two files associated with each e-mail message, one beginning with qf, the other beginning df. qf files contain the message header, df files contain the body of the mail message.

Below are the steps to follow to send a mail from unix machine.

Step 1.
Have to enable the mail option in /etc/mail/sendmail.mc file
enable the line called DEAMON_OPTION('port=smtp)
Dont change anything in config file .

Step 2.
Restart the sendmail dameon
service sendmail restart

Step 3.
Use the below command to send mail.
echo " your message "| mail -s " subject" e-mailid

You can use mailx command also to send mail.
echo "your message "| mailx -s "dada" e-mailid

Also stop the mail using this command.
/etc/init.d/sendmail stop | start

check with command mailq whether its sent or not.

To force flush the mailq, run this:

sendmail -v -d8.20 -q

Use mailq to get the mail-id
Then go to /var/spool/mqueue and delete all files with the specified mail-id on the end:
rm *

Labels:

 
 
How to install and configure Telnet services.
To install the telnet service, login to the server as the root user account

1)
Fedora linux user following command:-
yum install telnet-server telnet

2)
chkconfig telnet on
service xinetd reload

3)
Go to the /etc/securitty file.

If tty has 1-11 listed lin by line, Add the pts 1 to 11 in end of the line as the same format of tty.
save the file and now you can able to telnet from the windows or Linux machine.

4)
telnet ipaddress.
 
 
How to Configure Samba on Fedora Linux

Samba can be used to allow connectivity between Linux and Windows(95,98,NT,2000)
Samba deamon is smbd. All of samba is configured in one single file, the smb.conf file.
This file, located at /etc/samba/smb.conf, allows you to specify which resources on the linux machine you wish to share and who they can be accessed by.

Below steps are followed to configure samba in Fedora Linux.
Step 1:
First create a directories and users
Create directories for Samba to use with Windows

#mkdir ram
Now we need to create users to access this directiory

#useradd ram
Now create a password for this user using the following command

#smbpasswd -a ram

Step 2:

Samba configuration
By default samba configuration file located at /etc/samba/smb.conf
In this file main section is Global where you can define all parameters and the example as follows

[global]
workgroup = MYGROUP
server string = Samba Server
log file = /var/log/samba/%m.log
max log size = 50
dns proxy = No
cups options = raw

[homes]
comment = Home Directories
read only = No
browseable = No

[printers]
comment = All Printers
path = /usr/spool/samba
printable = Yes
browseable = No

[samba]
comment = ram
path = /freesapce/Ramkumar
valid users = ram
writable = yes

Add at in inside samba part.
* which path you need to share the folder in Linux.
* which user have a authorised to login.

Step 3:
Samba Service

Now that everything has been configured, the final step is to start the samba service. Samba runs in the background
as a linux daemon. Therefore, it can be controlled by typing:

service smb start
service smb stop
service smb restart
(or)
#/etc/init.d/samba restart

Note that once the computer is restarted or shutdown, the samba service won't start up again.

Step 4:
Connect to the samba server

Type the ip address in run prompt.
it will connect to linux box.
and try to access as your username and passwd.
then it connect and show the folder which you have created.
Now you can share the file with unix machine.
 

Name:

5 Words to sum up - Internet, Photography,Reading,Friends, Technology

Archives
January 2008 / June 2008 / September 2008 / November 2008 / January 2009 /


Powered by Blogger

Subscribe to
Posts [Atom]