Posts

Showing posts from 2010

SERVER CONFIGURATION FILE SYNTAX CHECKING COMMANDS

SERVER CONFIGURATION FILE SYNTAX CHECKING COMMANDS Basically configuring servers in Linux/*nix include editing of configuration files and saving them. Once editing the files if any syntax error is there and when we start the service they will show some wearied errors which we cant resolve. For counter attacking this type of issues for each service there will be one command to check this syntax errors before starting of the service/server, I have collected these commands from my experience and from some of my friends. Please feel free to comment on this if you know some other commands so that I will update my post. SSHD server check for syntax error ========================= sshd -t FTP server check for syntax error ========================= #vsftpd DNS server check for syntax error ========================== For checking syntax errors in main configuration file.. #named-checkconf main-config-file Example: #named-checkconf named.conf Syntax OK #named-checkzone doma...

Automatic Login through SSH

[root@server2~]#ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.2.202 21 root@192.168.2.202's password: Now try logging into the machine, with "ssh '192.168.2.202'", and check in:   .ssh/authorized_keys to make sure we haven't added extra keys that you weren't expecting. [root@server2~]#ssh 192.168.2.202 Last login: Thu Dec 23 18:25:19 2010 from 192.168.2.200 [root@server3 ~]#

How to connect, install and configure TATA Photon in Linux

This post explains how to connect your Tata photon dongle to a Redhat Linux system. It works on other Redhat distributions like Fedora, CentOS too. The procedure is explained in step by steps below. Steps. 1. Connect / Plug your photon+ to the system and wait till it gets ditected. 2. Open a terminal, run a command "dmesg" and check it is showing the modem name as HUAWEI. 3. Run another command "sudo wvdial" and its will create a config file in /etc/wvdial.conf, something like shown below. (if u dont have wvdial, you can download it from open.alumnit.ca) by running "cat /etc/wvdial.conf" or you can edit it using the commadn "vi /etc/wvdial.conf" # [Dialer Defaults] Modem = /dev/modem Baud = 115200 Modem Type = Analog Modem Init1 = ATZ Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 [Dialer info] Init9 = AT&V [Dialer photon+] Modem = /dev/modem Baud = 115200 Modem Type = Analog Modem Init1 = ATZ Init2 = ATQ0 V1 E...

How to install and configure a mail server using Postfix + Dovecot + squirrelmail in linux

This post helps to install and configure a mail server with postfix as MTA[ (Mail Transfer agent), Dovecot as MDA (Mail Delivery Agent) and Squirrel mail as MUA (Mail User Agent). This is a simple basic configuration without much advanced configurations. This is tested in Redhat linux and will also work in other redhat disrtos like fedora, centos etc. Assuming you have a configured yumserver. Else use the rpms. #yum install postfix* dovecot* Squirrelmail* Steps 1. Configure the DNS eg: example.com 2. Select the defalt MTA as postfix. Most systems it will be Sendmail. #alternatives     --config    mta Select postfix. 3. open the configuration file of Postfix and edit the following. #vi /etc/postfix/main.cf edit the following  1. my domain  2. my hostname  3. inet_interfaces and reload the service. 4. Configure the Squirrel mail #cd /usr/share/squirrelmail/config/ run the perl file #./conf.pl Give ...

User administration in redhat linux

User administration in Linux In Linux there are three type of users. 1. Super user or root user Super user or the root user is the most powerful user. He is the administrator user. 2. System users System users are the users created by the softwares or applications. For example if we install Apache it will create a user apache. This kind of users are known as system users. 3. Normal users Normal users are the users created by root user. They are normal users like John, Ramu etc. Only the root user has the permission to create or remove a user. In linux systems every user will have a unique user ID. It is known as UID. The Range of UIDs will be as follows: 1. Root user          UID will be "0" 2. Systems users      UID will be "1 - 499" 3. Normal users       UID will be "500 - 60000" The range of MIN_GID and MAX_GID is specified in the file  "/etc/login.defs". ...

How to install and configure Nagios Monitoring tool in redhat linux rhel5 or centos

This article will help you to install and configure Nagios monitoring tool in redhat linux or other redhat distributions like fedora, centos etc. Nagios Installation : Installing packages. Apache, PHP, GCC & GD Installing Apache web server: #yum -y install httpd* set hostname in FQDN #service httpd on Installing PHP, GCC and GD: #yum -y install php* #yum -y install gcc* #yum -y install gd* Getting the package: Get the latest packages from net. Mov it to some directory and untar them. #wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.2.0.tar.gz #mv nagios-3.2.0.tar.gz  /usr/local/src #tar xvf nagios-3.2.0.tar.gz #wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.14.tar.gz #mv nagios-plugins-1.4.14.tar.gz/usr/local/src #tar xvf nagios-plugins-1.4.14.tar.gz Adding nagios user and setting password for that user: #useradd nagios #passwd nagios usermod -a -G nagios apache    ...

How to configure syslog server or a centralized log server in redhat linux rhel5 or centos

This article will explain installing and configuring a syslog log server in redhat enterprise linux. It'll work in other redhat distributions like centos, fedora etc. Centralized log server (syslog server) Suppose we have a server and 5 client machines. And we want to monitor the logs of all those client machines. In situations like this, we will use centralized server as a log server. Whatever events are happening in client machines, the logs will be sent to the server. So that we can monitor all the logs from a centralized server. We make use of syslog service for this. Configuration of server machine(syslog server) Service name: syslog configuration file: /etc/sysconfig/syslog Steps: 1. Open the /etc/sysconfig/syslog file and add "-r" option to the variable SYSLOGD_OPTIONS as shown below. [root@server ~]# cat /etc/sysconfig/syslog # Options to syslogd # -m 0 disables 'MARK' messages. # -r enables logging from remote machines # -x disables DNS l...

Samba :: Shutdown Windows System from Linux Terminal

[root@server2/data1]#net rpc SHUTDOWN -I IP -U User Password: Shutdown of remote machine succeeded

Linux Interview Questions:Google

Q2) Write a command to find all of the files which have been accessed within the last 30 days. A1) The Command is , find / -atime +30 A2) # find / -type f -mtime +30 A3) find / -type f -mtime -30 A4) find / -type f -atime -30 = accessed find / -type f -ctime -30 = changed find / -type f -ctime -30 = modified Q3) How to schedule cron backup to run on 4th saturday of month?? A1) crontab -e ** ** ** ** /5 Q4) how to see unallocated hard disk space on linux A1) simply type cat /proc/partitions A2) df -h /dev/devicename device name could be hda,sda Q5) find out what file systems supported by kernel? A1) # fdisk /dev/hdx option: t it will show the supported FS in the kernel A2) cat /proc/filesystems will show all the file system types that the kernel can handle currently. Be aware that kernel will load the necessary modules automatically if it have, for a new file system type present in a new device you plug into it and then the output of the above command will vary. A3) you can give foll...