Categories
CentOS CentOS 5.2 Tutorials CentOS 5.3 Tutorials CentOS 5.4 Tutorials CentOS 5.5 Tutorials CentOS 5.6 Tutorials CentOS 5.7 Tutorials CentOS 5.8 Tutorials CentOS 6.0 Tutorials CentOS 6.1 Tutorials CentOS 6.2 Tutorials CentOS 6.3 Tutorials CentOS 6.4 Tutorials Fedora MISC

Transferring Files using Netcat

Netcat is a great cross platform tool, it can be used for just about all things related to or involving TCP or UDP. Its most practical use is transferring files using Netcat from one machine to another via a network. Where non *nix people usually don’t have SSH installed or set-up, it is much faster to transfer files using Netcat than setup SSH. Netcat is just a single executable, and works across all platforms (Windows,Mac OSX, Linux).

On the Netcat receiving end

# nc -l 1234 > out.file

This will start Netcat listening on port 1234.

On the Netcat sending end

# nc -w 3 [destination] 1234 < out.file

This will connect to the receiver and begin transferring files using Netcat.

If you’d like to transfer files quicker (*nix only I am afraid), you can compress the file during sending process

On the Netcat receiving end

# nc -l -p 1234 | uncompress -c | tar xvfp -

On the Netcat sending end

# tar cfp - /some/dir | compress -c | nc -w 3 [destination] 1234
Categories
CentOS 5.3 Tutorials CentOS 5.4 Tutorials CentOS 5.5 Tutorials CentOS 5.6 Tutorials CentOS 5.7 Tutorials CentOS 5.8 Tutorials

CentOS: Configure network

This tutorial is intended for system administrators wanting to either change the IP address or add additional LAN cards (NIC) on their CentOS 5 system. There are a couple of ways to configure the network card using the command line but only some commands will take immediate effect on kernel. If you are doing this remotely remember that you will lose connectivity or if your configuration on your network is incorrect be unable to connect.

Configure network with immediate effect

Using a single command line to configure the network

# ifconfig eth0 192.168.0.10 netmask 255.255.255.0

[or]

# ip addr add 192.168.0.10 dev eth0
Categories
CentOS 5.2 Tutorials CentOS 5.3 Tutorials CentOS 5.4 Tutorials CentOS 5.5 Tutorials CentOS 5.6 Tutorials CentOS 6.0 Tutorials

How to check your CentOS version

Most Red Hat-based distributions, like CentOS, should have a file called redhat-release which will contain the CentOS version.

# cat /etc/redhat-release
CentOS release 5.5 (Final)

or

# rpm -q centos-release
centos-release-5-5.el5.centos.1

and finally

# lsb_release -i
Distributor ID: CentOS
# lsb_release -r
Release: 5.5
# lsb_release -d
Description: CentOS release 5.5 (Final) 
Categories
CentOS 5.3 Tutorials CentOS 5.4 Tutorials CentOS 5.5 Tutorials CentOS 5.6 Tutorials CentOS 5.7 Tutorials CentOS 5.8 Tutorials

CentOS 5 Change Hostname

In this CentOS tutorial we will be showing you how to find and change the hostname of your system.

The assumption is that you are running as root and have a basic understanding of the software required but if you follow this tutorial you should be able to complete the task successfully.

Let us begin by finding the CentOS systems fully qualified domain name (FQDN) by seeing how it identifies itself.

Print the network node hostname

# uname -n
centos01.how2centos.com

Show the systems DNS domain name

# dnsdomainname 
how2centos.com