Neo

This user hasn't shared any biographical information


Posts by Neo

How to understand IPv6 address and types

IPv6 uses 16 bytes (128 bits) to represent and IP address as opposed to 4 bytes (32 bits) in IPv4. IPv6 uses colon separated hexa-decimal notation as opposed to dotted-decimal notation in IPv4.With 128-bit long IP address size, IPv6 can provide 2^128 addresses. In a simple decimal notation, it takes up to 39 digits making it harder to memorize. To make it relatively convenient, an IPv6 address is represented by a series of 16 bit hexa-decimal values separated by colons. An example IPv6 address is as follows.

2001:0da3:02f0:d413:4e39:7b9a:e2cd:08a2

The leading zeros can be omitted for simplicity. The above IPv6 address looks like More >

How to reboot a Linux system remotely using ssh or telnet

You can simply login to the remote system using SSH and execute “reboot” command to reboot it. But you must be logged in “root” user to be able to reboot the remote Linux system.

This example shows how to login using IP address.

[root@neo.techpulp.com ~]# ssh root@192.168.123.55

This example shows how to login using remote host name.

[root@neo.techpulp.com ~]# ssh root@www.techpulp.com

Typically after a successful login, you will get access to shell. You can run “reboot” command to reboot the remote system. This action will automatically terminate you current SSH session.

Otherwise, you use the following example to do the job with single command.

[root@neo.techpulp.com ~]# ssh More >

How to start or stop or restart a service in Fedora/RHEL/Ubuntu/Debian Linux

The following examples show how to start or stop or restart a service in different flavours of Linux. In all these examples, the service name “httpd” is used. You can replace it with name of the service you want to start or stop or restart.

Starting a service

In RHEL or Fedora:

[root@techpulp ~]# service httpd start

or

[root@techpulp ~]# /etc/init.d/httpd start

In Debian Linux:

[root@techpulp ~]# /etc/init.d/httpd start

In Ubuntu Linux:

[root@techpulp ~]# sudo /etc/init.d/httpd start
Stopping a service

In RHEL or Fedora:

[root@techpulp ~]# service httpd stop

or

[root@techpulp ~]# /etc/init.d/httpd stop

In Debian Linux:

[root@techpulp ~]# /etc/init.d/httpd stop

In Ubuntu Linux:

[root@techpulp ~]# sudo /etc/init.d/httpd stop
Restarting a service

In RHEL or Fedora:

[root@techpulp ~]# service httpd restart

or

[root@techpulp More >

How to scan a host for open ports in Linux

It is better to scan the server once to detect any unwanted services. It helps in harden the security of the server and minimizes security threats. Linux provides a command nc command to scan the open ports on a host. Typically it comes with default installation. If not, you can use following command to install it.

yum -y install nc

To scan a host with IP address “172.16.5.20″ for ports ranging from 1 to 1023, use the following command.

[neo@techpulp ~]# nc -z 172.16.5.20 1-1023
Connection to 172.16.5.20 80 port [tcp/http] succeeded!
Connection to 172.16.5.20 443 port [tcp/ssh] succeeded!
Connection to 172.16.5.20 904 More >