Saturday, 17 September 2011

Tree - A better way than plain 'ls'

As we all know about 'ls' it will list the directory or files in the folder we are located. We can use ls -l to list in a list format, etc - but there is a better colorful way to list your files and folder, its called "tree". It is an external tool and needs to be installed (if you are using Ubuntu it will spell out what to type to install the tool).

To use the command, just type "tree" or "tree Directory/" to list all the files in tree format. Here is a demo :

user1:~$ tree Desktop/
Desktop/
├── 66.txt
├── CM-Phone-to-PSTN.odg
├── nature7.jpg
├── table_export.xls
└── www.zip

0 directories, 5 files

Ofcourse, in color :).

Friday, 16 September 2011

Installation Steps on WEBMIN and NAGIOS

===============================
WEBMIN

# wget http://prdownloads.sourceforge.net/webadmin/webmin-1.560-1.noarch.rpm
# rpm -ivh webmin-1.560-1.noarch.rpm
# vi /etc/sysconfig/iptables
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 10000 -j ACCEPT


http://server:10000/


=====================
NAGIOS

http://assets.nagios.com/downloads/nagiosxi/docs/XI_Manual_Installation_Instructions.pdf
# cd /tmp
# wget http://assets.nagios.com/downloads/nagiosxi/xi-latest.tar.gz
# tar xzf xi-latest.tar.gz
# mkdir /root/tmp/
# cd /tmp/nagiosxi
# ./fullinstall

SQUID proxy server

PROXY srvr


# yum install squid
# vi /etc/ squid/squid.conf
# Squid normally listens to port 3128 ------ #you can change this port
http_port 3128

#Recommended minimum configuration:
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl QPNOC src 192.168.1.0/24 --------------- add you network to access list

# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
# Example rule allowing access from your local networks. Adapt
# to list your (internal) IP networks from where browsing should
# be allowed
#acl our_networks src 192.168.1.0/24 192.168.2.0/24
#http_access allow our_networks
http_access allow QPNOC -----------------------# allow the nework you add in the ACL
and make sure you add it before http_access deny all

# And finally deny all other access to this proxy
http_access allow localhost
http_access deny all

# service squid restart
# ntsysv
# vi /etc/sysconfig/iptables ---- add the port to the table (port that you define to squid.conf)
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3128 -j ACCEPT

# service iptables restart

# tail -f /var/log/squid/access.log ------ users websites access, etc


Lot of stuff in the config file that you can play around.

You can tweak firewall too, so that when the users make it as a gateway, it will redirect all web traffic to proxy server

Tuesday, 13 September 2011

FPing - ping multiple hostnames

Just learn't about this new command and thought I should share:

fping hostname1 hostname2 hostname3 ....etc

The result will show if the units are alive or not. Better than pinging them individually :)
And ofcourse, as with any linux commands - they do have options for more granularity.

Friday, 9 September 2011

Ubuntu FTP Setup

A successful attempt was made to setup FTP on our linux server. Steps are listed below, as root user:

#yum install vsftpd (Install the FTP Server)
#cd /etc/vsftpd/
#vi vsftpd.conf
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=NO

#vi ftpusers   -  List of all blocked users
#ntsysv --- check the service or daemon you want to start automatically when the server boot-up
#service vsftpd restart  -- restart the ftp server
# vi /etc/sysconfig/iptables --- open FTP port of firewall
#service iptables restart --- restart the firewall

 Add username and password
#useradd adil
#passwd adil

Linux Dudes - Lets the games begin!

This blog is put in place by myself and colleagues(listed on the right as contributors) in order to make an attempt in learning what it takes to be a decent Linux Administrator. Most of us come from a Windows background and albeit we do understand what is required to make a technology function, Linux is an area where we feel we need a LOT of experience.

The reason for creating this blog is to make Linux Notes that we can refer back to - make attempts and share those experiences to anyone who stumbles across this blog.

Wish us all the best! :)