Networking
How to find IP address of an interface using bash scripting
Oct 1st
In Linux, ifconfig command is used to view the information about network interfaces. Let us examine the output of the command to determine how we can parse the information for IP address.
[neo@techpulp ~]# ifconfig eth0 eth0 Link encap:Ethernet HWaddr 03:A6:2E:52:3D:BA inet addr:66.27.16.64 Bcast:66.27.16.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:14257 errors:0 dropped:0 overruns:0 frame:0 TX packets:4364 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:4831053 (4.6 MiB) TX bytes:663388 (647.8 KiB) Interrupt:21 Base address:0x2000 [neo@techpulp ~]#
The IP address information is present in second line containing keyword “inet addr”. The following script accepts an interface name as command line argument More >
How to bind a service under xinetd to a specific ip address
Sep 3rd
As an administrator, you wouldn’t want external users to access a new service while you are setting it up. In such cases, you might want to bind the service to loop-back address (127.0.0.1) until you are sure that service is functional and not vulnerable. As a Desktop user, to increase security of the system, you can turn off unused services and change the bind address to loop-back for the servers that are not expected to be accessed from outside.
Coming to the actual topic of changing bind address of a service under xinetd, you need to add a line similar to More >
How to solve ‘Stale NFS file handle’ error while accessing or unmounting a NFS volume
May 14th
This error is typically seen in a system which has active NFS mount point. The NFS protocol doesn’t define any automatic way of communication for any change of NFS server configuration. For example, if a client system mounts an NFS volume and the Administrator at the NFS server removes the directory from the NFS exported list, The client system will not know the change of configuration at NFS server side. In such cases, the ‘df’ command starts showing this error ‘Stale NFS file handle’.
Similar error is seen when a file or directory is deleted in the NFS server while the More >
How to export a NFS volume in Fedora or RedHat Linux
May 9th
NFS stands for Network File System and is a easy way to share files across Linux systems. However the downside of NFS file sharing is that shared folder can’t be protected with a password. But you can limit access to particular IP addresses.
The Fedora Linux system comes up with NFS utilities by default. Otherwise you can install them using “yum” as shown below:
[root@techpulp ~]# yum install -y nfs-utils rpcbind
You can enable the NFS service to start at boot time using the following commands. The “rpcbind” service also needs to be enabled as NFS internally using RPC service. But if you More >
How to enable auto login for SSH
Apr 23rd
This article assumes that the host name of server is “server1.techpulp.com” and that of client machine is “client1.techpulp.com“. You can replace these with your own domain names or IP addresses to suit your needs.
Login to the server system to which you would like password-less login.
[neo@client1 ~]$ ssh neo@server1.techpulp.com neo@server1.techpulp.com's password: [neo@server1 ~]$
Generate a RSA key pair in the server as shown below. Just press ENTER key when it prompts for passphrase. The following example may be exactly as shown below and may vary based on the version of ssh-keygen present in your server system. But it prompts you for same input More >
How to resolve “POST to /wp-admin/post.php not supported” error in WordPress
Feb 1st
Sometimes while posting in WordPress blog software, users encounter the following error and fail to submit the new post or edited post.
Method Not Implemented POST to /wp-admin/post.php not supported. Apache/2.2.0 (XenOS) Server at techpulp.com Port 80
This error is due to mod_security which is enabled on your Apache server. The mod_security helps protect your website and is called Open Source Web Application Firewall. It comes with a big set of rules against which each server request is matched to detect any hacker trying to compromise your website. In a way mod_security is very good to have it enabled as a security measure. but More >
What is DMZ network and why is it needed
Jan 29th
In networking terminology, the DMZ network is defined as a network which is less restricted as opposed to corporate network (LAN) which can never be accessible to outside world directly. It is always recommended that all public servers like web server, ftp server etc be places in a physically separate network from corporate network. This is to eliminate possibility of compromising a corporate system if any of the public servers is compromised.
The Network Firewall plays a key role in controlling the in-bound connections. In this case, any connection coming from Internet is denied if it attempt to reach LAN/corporate network. More >
How to disable Firewall in Fedora or Debian Linux systems
Jan 14th
If you have come across a problem of not able to access a service like httpd even if the server is running, most probably the Firewall is blocking the port. The quick way of checking it is to disable Firewall and try again. However this method of disabling firewall may not be recommended on production servers.
The following command tells you if firewall (iptables) is active on the Fedora Linux system.
[root@techpulp ~]# /sbin/service iptables status Table: filter Chain INPUT (policy ACCEPT) num target prot opt source destination 1 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED 2 ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 More >
FTP – How to upload/download or delete directories recursively
Jan 14th
The standard FTP program doesn’t support recursive operations on directories. The ncftp command supports recursive operations. This is very useful if your web hosting supports only FTP transfer.
First of all, check if ncftp command is already present in your Linux system.
[neo@techpulp ~]# ncftp bash: ncftp: command not found [neo@techpulp ~]#
If it is not present, then install appropriate package using “yum“.
[root@techpulp ~]# yum -y install ncftp
The following shows how to use ncftp to use a specific login instead of anonymous login.
[neo@techpulp ~]# ncftp -u neo liz.techpulp.com NcFTP 3.2.2 (Aug 18, 2008) by Mike Gleason (http://www.NcFTP.com/contact/). Connecting to 127.0.0.1... (vsFTPd 2.0.7) Logging in... Password More >
How to find IP address of DNS Server in Linux
Dec 8th
The file “/etc/resolv.conf” contains IP addresses of DNS servers along with domain name. A example file is shown below.
[neo@techpulp ~]$ cat /etc/resolv.conf nameserver 202.64.38.98 nameserver 202.64.39.98 [neo@techpulp ~]$
In the above example, Two DNS servers are configured in my system. If you find problems in resolving domain names, just check if the DNS server is reachable or not using “ping” program. If the DNS server is up then you should see ping reply from it as shown below.
[neo@techpulp ~]$ ping 202.64.38.98 PING 202.64.38.98 (202.64.38.98) 56(84) bytes of data. 64 bytes from 202.64.38.98: icmp_seq=1 ttl=64 time=0.993 ms 64 bytes from 202.64.38.98: icmp_seq=2 More >


Recent Comments