Archive | Linux/Unix RSS feed for this section

Basic Selinux Policy

#To see context ls -Z #To see selinux status sestatus #To switch Selinux into Permissive mode on the fly to debug setenforce 0 #To switch Selinux into Enforcing mode on the fly to debug setenforce 1 #To see selinux log tail -f /var/log/audit/audit.log #SELinux security context of the httpd process codero1:/var/www/html# ps axZ |grep httpd […]

Read more

Reset mySQL replication

cd /home/anuj/dump mysql -p FLUSH TABLES WITH READ LOCK; SHOW MASTER STATUS; +—————+———–+————–+——————+ | File          | Position  | Binlog_Do_DB | Binlog_Ignore_DB | +—————+———–+————–+——————+ | binlog.000662 | 166715532 |              |                  | +—————+———–+————–+——————+ 1 row in set (0.00 sec) mysqldump  –opt  lory –lock-all-tables –add-drop-table > lory.sql mysqldump  –opt  rons –lock-all-tables –add-drop-table > rons.sql UNLOCK TABLES; quit; scp […]

Read more

Setting Up SSH on Cisco Router

R1(config)# hostname R1 R1(config)#ip domain-name anuj.com R1(config)#username anuj password shrestha R1(config)#crypto key generate rsa choose default or 1024 and press enter and wait for a while to get the message that SSH has been enabled R1(config)# line vty 0 4 R1(Config)# login local R1(config-line)#transport input ssh Try logging from another host using ssh—-

Read more

misc

[root@mbox /home/anujstha]# cat CreateMaildir.sh #!/bin/bash echo “Enter username” read USER echo “Enter qmail uid” read QMAILUID initial=$(echo ${USER:0:1}) mkdir -p /mbox/$initial/$USER /var/qmail/bin/maildirmake /mbox/$initial/$USER/Maildir/ echo “|/usr/bin/qmailquota” > /mbox/$initial/$USER/.qmail echo “./Maildir/” >> /mbox/$initial/$USER/.qmail echo “10000″ /mbox/$initial/$USER/.quota chown ${QMAILUID}:55 /mbox/$initial/$USER chown -R ${QMAILUID}:55 /mbox/$initial/$USER/Maildir/ echo “User : ${USER}” echo “QMAILUID : ${QMAILUID}” echo “Initials : ${initial}” ######################################## CREATE […]

Read more

mod_fcgid + nikto

mod_fcgid—— cd /usr/local/src http://downloads.sourceforge.net/mod-fcgid/mod_fcgid.2.2.tgz?use_mirror=nchc tar -xzvf mod_fcgid.2.2.tgz cd mod_fcgid.2.2 vi Makefile (define apache/apxs location) make make install NIKTO—- cd /src wget http://www.cirt.net/nikto/nikto-current.tar.gz tar -xzvf nikto-current.tar.gz wget http://www.wiretrip.net/rfp/libwhisker/LW.pm cp LW.pm ./nikto/LW.pm mv nikto-1.35/ /usr/local/nikto cd /usr/local/nikto perl nikto.pl -update perl nikto.pl -h localhost perl nikto.pl -h example.com -evasion 1

Read more
Random Pages By Best Accounting Services