Author: Sahil Suri

Using Ansible playbook to install Docker on Centos 7

Introduction Docker is a containerization engine and platform that encapsulates application code along with all of its dependencies inside a container. Containers are like virtual machines but they are more portable, more lightweight, and more dependent on the host operating system. Please do check out our extensive series of posts on docker. In this article, we will explain how to install docker using an Ansible Playbook. Ansible at its core is a task execution engine. It exists to provide a method for developers, operators, and engineers to easily define one or more actions to be performed on one or more computers. This capability represents a step beyond just logging into each computer in question and manually typing out the commands. These tasks can target the local system ansible is running on as well as other systems ansible can reach over the network. Arguably the ability to manage remote systems is the most important aspect of ansible. When combined with the ability to express tasks to be performed in the form of simple to read text files, ansible provides a reusable and repeatable system for managing a fleet of infrastructure. In this post, we will explain how to use a simple ansible playbook to automate the steps described in our earlier post explaining the installation of docker on centos 7.   Pre-requisites In order to use the automated setup to install docker...

Read More

Setting up chrooted ssh jails in Linux

Introduction In one of our previous articles we demonstrated how to configure chrooted sftp user accounts.  Along with the configuration of chrooted sftp accounts you can actually configure a mechanism for chrooted ssh access as well. This type of chrooted ssh setup is commonly referred to as a chroot jail and we will be explaining it’s configuration step by step in this article. Chrooted jails are a means of separating specific user operations from the rest of the Linux system.  This configuration changes the apparent root directory for the current running user process and its child process with new root directory called a chrooted jail. Step 1: Create chroot home directory. [root@linuxnix ~]# mkdir -p /chroot/home/sahil [root@linuxnix ~]# ls -ld /chroot/home/sahil drwxr-xr-x. 2 root root 4096 Jul 22 22:34 /chroot/home/sahil [root@linuxnix ~]# [root@linuxnix ~]# chmod 700 /chroot/home/sahil We need to disable SELinux for this setup to work. [root@linuxnix ~]# setenforce 0 We will be copying certain binaries and library files into this directory. So, let’s create the sub-directories in which we will place these binaries and library files. [root@linuxnix ~]# cd /chroot [root@linuxnix chroot]# mkdir bin/ lib64/ lib/ dev/ [root@linuxnix chroot]# ls bin lib lib64 dev [root@linuxnix chroot]# Now under the dev/ directory we will be creating certain required character device files using the mknod command. In the command below, the -m flag is used to specify the file permissions...

Read More

How To exclude copying of specific directories in Linux using cp/scp/rsync

Introduction Performing file copy operations between servers is a common task for any system administrator or a generic Linux operating system user. While copying files from one system to another we might need to exclude certain files and directories from being copied due to some specific reason. This could be applicable even when we are transferring data from one location to another on the same system. In this article we will demonstrate how you can exclude certain files or directories or being copied using the three most common and widely used utilities employed for this purpose i.e. rsync, cp and scp. In an earlier article, we discussed the rsync command in depth with a lot of examples. Exclude specific Files/Directories from being copied using cp command: Consider the following scenario wherein I have five directories in my current working directory. [root@linuxnix tmp]# ls -ld dir* drwxr-xr-x 2 root root 6 Aug 29 22:47 dir1 drwxr-xr-x 2 root root 71 Aug 29 22:47 dir2 drwxr-xr-x 2 root root 6 Aug 29 22:47 dir3 drwxr-xr-x 2 root root 6 Aug 29 22:47 dir4 drwxr-xr-x 2 root root 6 Aug 29 22:47 dir5 I would like to copy the content of all directories starting with the name dir except the dir2 directory then I could do the following: [root@linuxnix tmp]# cp -r `ls -A | grep dir| grep -v "dir2"` /tmp/sahil/ This...

Read More

Over 16,000 readers, Get fresh content from “The Linux juggernaut”

Email Subscribe

ABOUT ME..!

My photo
My name is Surendra Kumar Anne. I hail from Vijayawada which is cultural capital of south Indian state of Andhra Pradesh. I am a Linux evangelist who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. At present I work at Bank of America as Sr. Analyst Systems and Administration. You can contact me at surendra (@) linuxnix dot com.