Showing posts with label commandline. Show all posts
Showing posts with label commandline. Show all posts

Thursday, 27 November 2014

See Open Ports in a Linux PC ( Localhost/Remote Machine)

I am writing a small post that will help you just to see what ports are open in  a particular remote/local machine.

we are going to use tool name as nc.

To install it , open your terminal and type as

 # yum install nc



                              After installing , you can use it with

nc -zv xxx.xxx.xxx.xxx <Port>

                                           for example:

nc -zv 192.168.1.100 80

                                          if you want to do that for 2-3 ports

nc -zv 192.168.1.100 80 8009

                                            if you want to do scanning for range of ports

nc -zv 192,168.1.100 80-8080


hope it will help you.

THANK YOU


Tuesday, 14 October 2014

Use Wget for downloading from FTP with username and Password

Hi , We all know we can use wget to download files from command-line.

Downloading files from FTP can be done but for with username and password you have to scroll manpage a lot.


wget --user <username> --password <password> ftp://xxx.xxx.xxx.xxx/dir/file/download


to resume

wget -c --user <username> --password <password> ftp://xxx.xxx.xxx.xxx/dir/file/download

Thursday, 17 July 2014

Take picture from terminal


PHPMyAdmin in your CentOS 6.X


Open your terminal and EPEL Repo

 wget http://epel.mirror.net.in/epel/6/i386/epel-release-6-8.noarch.rpm 
rpm -Uvh epel-release-6-8.noarch.rpm

Then Add Remi

rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm 

Now open /etc/httpd/conf.d/phpMyAdmin.conf file and enter the address field with address from where you want access PhPMyAdmin remotely cause it is accessed by default from localhost only.

vim /etc/httpd/conf.d/phpMyAdmin.conf
 

Next restart your httpd with

service httpd restart 
 
Open your browser and type there as localhost/phpmyadmin and login with your mysql username and password. If you want browse remotely then your IP must allowed( added ) from above mentioned configuration file. Note: This information has taken from several sources.

Wednesday, 18 June 2014

Sending mail from CentOS

Actually sending mail from a CentOS server/Desktop install is pretty easy. You can do that in many ways but I like this way because it is simpler.

Before sending the mail, the content of your mail if you store at some place would be better. assume like I have stored my message /tmp/body file.

Then I will sent my message as

mail -s "This is subject of message" raja@raja.com < /tmp/message

thats it. check for your mail in inbox/spam/junk box.

Create Bootable Linux ISO from DD command


I have tried many times to create a Bootable USB linux from ISO but failed almost 20 times. After a lot of googling I have found as this is the proper command

dd if=/path/to/ISO.iso of=/dev/sda bs=4M;sync

Thats it. Note: at of=/dev/sda dont give anything after your device. for example If your USB mounted as /dev/sdb1 then at of you should give as of=/dev/sdb only.

Thursday, 13 March 2014

CentOS - IP Setting - Static IP- Command Line

Commands required to set a static IP in CentOS  are

. In Terminal , turn into root user and type as

vi /etc/sysconfig/network-scripts/ifcfg-eth0
There Place the content as





There as you can see the parameter. Set similar in your PC.Then save & close it with <Shift> + <:> +<w> + <q> .

Then In terminal type as

vi /etc/sysconfig/network

There give your Gateway as shown






You can disable/Enable network from there.

Then check your Gateway updated or not with

route -n

Then after that restart your network with

service network restart


Thats it. Now you can connect to your CentOS to Internet.
Points to remember : Nothing much !! all you have to execute the commands as root user.