iptables -L -n
this will show u iptbales details
iptables-I INPUT -J DROP
it will block every system to access the system
In order to configure firewall using IP table use command
iptables -I -s INPUT 192.168.10.100 -J ACCEPT
Thursday, 14 July 2011
Setting up of DNS in Debian System
Open the file
gedit /etc/resolv.conf
simply add your DNS address to /etc/resolv.conf
let us imagine that over DNS server address is 192.168.10.100
simply add this address to your /etc/resolv.conf and save changes
i.e. name server 192.168.10.100
Your DNS will be set up
gedit /etc/resolv.conf
simply add your DNS address to /etc/resolv.conf
let us imagine that over DNS server address is 192.168.10.100
simply add this address to your /etc/resolv.conf and save changes
i.e. name server 192.168.10.100
Your DNS will be set up
How to set hostname in debian
/bin/hostname
this will show your current hostname
then
/bin/hostname (new name)
e.g
/bin/hostname Debina
your hostname will be set to Debian now
this will show your current hostname
then
/bin/hostname (new name)
e.g
/bin/hostname Debina
your hostname will be set to Debian now
Wednesday, 13 July 2011
How to Schedule Cron Jobs for taking data backup in debian.
Open root terminal
write command
crontab -e
# m h dom mon dow command
m stands for minutes
h stands for hours
dom stands for day of month
mon stands for month
dow stands for day of week
# m h dom mon dow command
15 13 13 5 5 cp -R /home/user /destination folder
This will copy you user data in destination folder on 1.59 Pm at 13th May.
write command
crontab -e
# m h dom mon dow command
m stands for minutes
h stands for hours
dom stands for day of month
mon stands for month
dow stands for day of week
# m h dom mon dow command
15 13 13 5 5 cp -R /home/user /destination folder
This will copy you user data in destination folder on 1.59 Pm at 13th May.
What is Cron tab syntax and examples
A crontab file has six fields for specifying minute, hour, day of month, month, day of week and the command to be run at that interval. See below:
* * * * * command to be executed
- - - - -
| | | | |
| | | | +----- day of week (0 - 6) (Sunday=0)
| | | +------- month (1 - 12)
| | +--------- day of month (1 - 31)
| +----------- hour (0 - 23)
+------------- min (0 - 59)
Writing a crontab file can be a somewhat confusing for first time users, therefore I have listed below some crontab examples:
* * * * * <command> #Runs every minute
30 * * * * <command> #Runs at 30 minutes past the hour
45 6 * * * <command> #Runs at 6:45 am every day
45 18 * * * <command> #Runs at 6:45 pm every day
00 1 * * 0 <command> #Runs at 1:00 am every Sunday
00 1 * * 7 <command> #Runs at 1:00 am every Sunday
00 1 * * Sun <command> #Runs at 1:00 am every Sunday
30 8 1 * * <command> #Runs at 8:30 am on the first day of every month
00 0-23/2 02 07 * <command> #Runs every other hour on the 2nd of July
As well as the above there are also special strings that can be used.
What is Cron Tab and what Cron job will do for you?
Cron tab(CRON TABle) is a text file that contains a series of cron functions for execution.Cron can perform number of jobs specified by users, it can use to take backup on daily/monthly/weekly basis and also on specified time and date. It can be used to e-mail courses to users at mentioned time. Cron can also be used to delete your website members with expired accounts. Finally we can say cron perform number of jobs automatically.
How to assign Static IP in debian machine
In order to assign the static IP we have to change the interface file i.e.
/etc/network/interface
gedit /etc/network/interface
auto eth0
iface eth0 inet static
address 192.168.10.1
net mask 255.255.255.0
broadcast 192.168.10.255
gateway 192.168.1.1
save these changes and restart network services
/etc/init.d/networking restart
and your Static IP will be set up
Subscribe to:
Posts (Atom)