This is useful when your linux box is used for sending emails. If hostname is incorrect, it will be detected by http://cbl.abuseat.org and will be blocked from sending emails.
Example of a computer's hostname: mybox.mydomain.com
Replace example hostname to your computer's hostname.
In Linux, to check the hostname if it is similar to this example:
[root@mybox ~]# uname -n
mybox.mydomain.com
[root@mybox ~]# hostname -s
mybox
[root@mybox ~]# hostname -d
mydomain.com
[root@mybox ~]# hostname -f
mybox.mydomain.com
[root@mybox ~]# hostname
mybox.mydomain.com
If it returns localhost.localdomain then it's wrong. If not then your linux box is ok. (Very big hint for me was that before, the command prompt was [root@localhost ~]#)
For a static IP Address, /etc/hosts is configured as follows:
127.0.0.1 localhost.localdomain localhost
192.168.0.xxx mybox.mydomain.com mybox
Change 192.168.0.xxx to your static IP Address.
Set hostname:
[root@localhost ~]# hostname mybox.mydomain.com
Check /etc/sysconfig/network file. Must have be like this:
NETWORKING=yes
HOSTNAME="mybox.mydomain.com"
For further reference:
http://www.cpqlinux.com/hostname.html
* Using Fedora Core 3
Wednesday, June 28, 2006
Tuesday, June 27, 2006
Forms: Input validation
Input text and text areas
- For required fields, is string empty? Remove trailing spaces.
- Scope of string. (numeric, letters only ??)
- Minimum and maximum length of string.
Input file
- Is string empty?
- Does file exist?
- File must be of valid type.
- Limit the type of files that can be uploaded.
Check box
- Grouped check boxes must be same name.
- If multiple check boxes, can check multiple boxes.
- If field is required, at least one check box checked or depending on specs.
Radio button
- Grouped radio buttons must be same name.
- If multiple radio buttons, can only check one radio button per group.
- If field is required, must have ticked a radio button.
Selections (Dropdown)
- Do not put default empty value if required field.
- Check other dropdown in same group if not selected. (like in date and time)
- For group selections, check format or combination.
Input submit (Submit button)
- Do not submit if there are invalid input in form.
Input reset (Reset button)
- All default values must be returned as if the form was loaded again from the start.
Thursday, June 22, 2006
Linux: Accept Local SSH only
Linux Firewall must be running.
In /etc/sysconfig/iptables
find the following line
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
and change to
-A RH-Firewall-1-INPUT -s xxx.xxx.xxx.0/24 -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
replace xxx.xxx.xxx.0 with local IP range.
restart firewall
[root@localhost ~]# service iptables restart
(Thanks to Sasi)
Subscribe to:
Posts (Atom)