Instalacion de netcat en linux (centos/fedora/debian)

Via yum:

yum install nc

Via apt-get:

apt-get install netcat

Algunas cosas utiles de netcat:

1.- Copiar imagen de disco duro de host A a host B

-----------------------
HostA // 192.168.1.1
------------------------
sda
NETWORK
sdb
------------------------
HostB // 192.168.1.2
-------------------------

En el host B ejecutamos: # netcat -p 2222 -l |bzip2 -d | dd of=/dev/sdb

Y en el host B ejecutamos:

# bzip2 -c /dev/sda | netcat hostA 2222 o se puede usar la ip:
# bzip2 -c /dev/sda | netcat 192.168.1.1 2222

On hostA, enter:
# nc -l 2222 > /dev/sdb
On hostB, enter:
# nc hostA 2222< /dev/sda
OR
# nc 192.168.1.1 2222< /dev/sda

Using a second machine (hostB), connect to the listening nc process at 2222 (hostA), feeding it the file (/dev/sda)which is to be transferred. You can use bzip2 as follows.
On hostA, enter:
# nc -l 2222 | bzip2 -d > /dev/sdb
On hostB, enter:
# bzip2 -c /dev/sda | nc 192.168.1.1 2222


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: