Author: Sahil Suri

5 Different ways to display IP addresses in Centos 7

Introduction Being knowledgeable about the commands associated with the manipulation of the network stack of the Linux operating system is important for Linux system administrators. Most of the commands that allow users to modify the networking of the system also allow us to obtain information about the servers’ network setup. This information includes mainly IP addresses and routing tables. In this article, we will look at five different ways by which we can display the IP address information about our server. For the purpose of this demonstration, we will be working on a Centos 7 system. Method 1: Using ifconfig command The ifconfig command is the most commonly used command for displaying and modifying IP addresses on the system. The name ifconfig is short for interface configuration. When used without any options or when used with the -a option it displays information about the interfaces available on the system and the IP address set on those interfaces. [root@linuxnix ~]# ifconfig ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.23.131 netmask 255.255.255.0 broadcast 192.168.23.255 inet6 fe80::830:c411:78b:6bb9 prefixlen 64 scopeid 0x20<link> ether 00:0c:29:7e:5f:4f txqueuelen 1000 (Ethernet) RX packets 810 bytes 80806 (78.9 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 394 bytes 54734 (53.4 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host>...

Read More

3 ways to automate file transfers using ftp

Introduction In some of our earlier articles we’ve explained the setting up of chrooted sftp and chrooted ssh accounts along with the setup of an ftp server using vsftpd. In today’s automation driven enterprise infrastructure environments we may often find ourselves in situations where we need to automate the transfer of files using the ftp/sftp protocol. Setting up passwordless tranfer of files using sftp is farily stragithforward.  Since sftp is based on the ssh protocol we can generate and use ssh keys to setup passwordless authentication to allow for automated file tranfers. In this article we will demonstrate three techniques using which you can automate the transfer of files using FTP protocol as well. Method 1: Using wget The wget command provides options to connect to the ftp server and download a file while specifying the credentials on the command line. In the below example, we connect to the ftp server with IP address 172.31.18.17 using the user name sahil and password as L#giN@123 and download the file download.txt. [root@sahilsuri0081 ~]# wget --user=sahil --password='L#giN@123' ftp://172.31.18.17/download.txt --2018-07-27 17:39:40-- ftp://172.31.18.17/download.txt => ‘download.txt’ Connecting to 172.31.18.17:21... connected. Logging in as sahil ... Logged in! ==> SYST ... done. ==> PWD ... done. ==> TYPE I ... done. ==> CWD not needed. ==> SIZE download.txt ... done. ==> PASV ... done. ==> RETR download.txt ... done. [ <=> ] 0 --.-K/s in 0s...

Read More

Journalctl command in Linux explained

Introduction In one of our earlier articles, we explained the basics of syslog/rsyslog log management system in Linux and provided a quick demonstration on how we could modify the rsyslog configuration to redirect logs to a particular destination. Systemd maintains a binary log of services and programs that it manages in a system journal. This binary log is written to and managed by the systemd-journald service. The journalctl command provides an interface to users to be able to query this log and read messages from it. In this article, we will demonstrate with examples how you could use the journalctl command line interface to extract desired information from the systemd journal. Example 1: Using journalctl without any options When used without any accompanying options, the journalctl command will print the entire systemd journal log. This would present a lengthy output to the terminal screen and would prove to be rather tedious to interpret. Given below is a quick snippet from the log: [root@linuxnix ~]# journalctl -- Logs begin at Wed 2018-02-21 12:56:32 IST, end at Wed 2018-02-21 13:01:01 IST. -- Feb 21 12:56:32 linuxnix systemd-journal[92]: Runtime journal is using 8.0M (max allowed 91.1M, trying to leave 136.6M free of 903.1M a Feb 21 12:56:32 linuxnix kernel: Initializing cgroup subsys cpuset Feb 21 12:56:32 linuxnix kernel: Initializing cgroup subsys cpu Feb 21 12:56:32 linuxnix kernel: Initializing cgroup subsys cpuacct Feb...

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.