Categories
CentOS

How to setup a SFTP server on CentOS

What is SFTP?

SFTP, is the acronym for SSH File Transfer Protocol, or Secure File Transfer Protocol, is a protocol packaged with SSH that works in a similar way as FTP but over a secure connection. The advantage is the ability to leverage a secure connection to transfer files. In almost all cases, SFTP is preferable to FTP because of its underlying security features and ability to piggy-back on an SSH connection.

FTP is an insecure protocol that shouldn’t be used.

Enable PasswordAuthentication in the sshd config file

Backup the current sshd_config

# cp /etc/ssh/sshd_config /etc/ssh/sshd_config.orig

Change it to READ-ONLY to ensure it don’t get overwritten

# chmod a-w /etc/ssh/sshd_config.orig
# vim /etc/ssh/sshd_config

Find the line with the phrase PasswordAuthentication and make it read:

PasswordAuthentication yes

Save your new sshd_config file and then restart the host machine’s ssh service:

# service sshd restart

Stopping sshd:                                             [  OK  ]
Starting sshd:                                             [  OK  ]

Connect to your host and login to your user account

To open an SFTP shell terminal as on the host machine, open a Terminal on your client machine and enter the following command, replacing with your host machine’s IP address hostname:

# sftp @
Connected to host.
sftp>
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

[CentOS-announce] Release for CentOS-6.5 i386 and x86_64

Message from Karanbir Singh on the CentOS lists
—–
Karanbir Singh <kbsingh at centos.org>
The CentOS Project {http://www.centos.org}
irc: z00dax at irc.freenode.net ( #centos, #centos-devel )
—–

We are pleased to announce the immediate availability of CentOS-6.5 install media for i386 and x86_64 Architectures. Release Notes for 6.5 are available at http://wiki.centos.org/Manuals/ReleaseNotes/CentOS6.5 – we recommend everyone looks through those once.

CentOS-6.5 is based on the upstream release EL 6.5 and includes packages from all variants. All upstream repositories have been combined into one, to make it easier for end users to work with.

There are many fundamental changes in this release, compared with the past CentOS-6 releases, and we highly recommend everyone stufy the Release Notes as well as the upstream Techical Notes about the changes and how they might impact your installation.

All updates released since upstream 6.5 release are also released to the CentOS-6.5 mirrors.

Everyone who has centos-cr repositories enabled and in use, would already be running CentOs-6.5 as of one week ago and will notice only the centos-release rpm update today.

Categories
CentOS CentOS 6.0 Tutorials CentOS 6.1 Tutorials CentOS 6.2 Tutorials CentOS 6.3 Tutorials CentOS 6.4 Tutorials

Install Nginx with PHP-FPM on CentOS 6

What is Nginx?

Nginx (pronounced “engine x”) is a free, open-source, high-performance HTTP server. Nginx is known for its stability, rich feature set, simple configuration, and low resource consumption.

What is PHP-FPM?

PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites.

Install the EPEL x86_64 YUM Repository

# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

Install Nginx

# yum install nginx

Install PHP and PHP-FPM

# yum install php php-mysql php-fpm php-common