Experiment with SSH and TCP Wrappers #DevOps

The idea was :

use two servers; server1, and server2
create user: user1 in both server1 and server2
use nmtui to assign IP Addresses to both
use ifdown and ifup to check if IPs are assigned properly
change /etc/hosts and add the server ips and names
use ping to know that you can reach each other
use ssh-key gen to create key files
use ssh-copy-id to transfer public key file to remote hosts
then use ssh commands to reach to without passwords
try scp and sftp : to copy files/folder to and from

Then use TCP wrappers to allow or deny remote hosts, users, or domains

SSH:

2 useradd user1
3 passwd user1
4 ip addr
5 nmtui
6 vim /etc/hosts
7 ping server2
8 ip addr
9 nmtui
10 ifdown ens33
11 ifup ens33
12 ping 192.168.1.200
13 vim /etc/hosts
14 ping server2
15 su user1

ssh-keygen
1 ssh server2 /bin/ls -l
2 scp file1 server2:
3 touch file1
4 scp file1 server2:
5 scp server2:/usr/bin/zip .

7 sftp server2
8 su root

10 w
11 last

13 tail /var/log/secure

15 sudo tail /var/log/secure

19 getcwd

24 ssh-keygen

27 ssh-copy-id -i ~/.ssh/id_rsa.pub server2

31 vim .ssh/authorized_keys
32 ssh server2

———————

TCP wrappers

/etc/hosts.allow : to allow to services from whom
/etc/hosts.allow : to deny to services from whom

Install TCP Wrappers. I used rpm as I turned off internet in the VMware workstation I used

27 rpm -ivh tcp_wrappers*
28 yum info tcp_wrappers
29 ls /etc/hosts.allow
30 vim /etc/hosts.allow
30 vim /etc/hosts.allow

example rules on hosts.allow

All:All
All:user1
All:user1@server2
All:.justetc.com
sshd:LOCAL
vsftpd:192.168.1.200
All Except sshd:192.168.1.200 From: http://sitestree.com/?p=11978
Categories:DevOps
Tags:
Post Data:2017-12-15 12:37:07

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

Learn some Centos/Redhat Linux: RHCE: MariaDB Administration on Redhat/Fedora/CentOS #DevOps #RHCE

RHCE: MariaDB Administration on Redhat/Fedora/CentOS

Check if mariaDB is installed or not

130 yum list installed | grep ^mariadb

mariaDB originated from MySQL – after MySQL Got Bought by Oracle

133 yum list installed | grep ^mariadb

I see – installed though not completely

Output:

mariadb-libs.x86_64 1:5.5.52-1.el7 @anaconda

There are two other components: mariaDB – client component. MariaDB-server: Server Component

The MariaDB packages:
138 mariadb-bench.x86_64 mariadb-devel.x86_64 mariadb-server.x86_64 mariadb-test.x86_64 mariadb.x86_64

Install all packages at once

139 yum install mariadb*
140 yum list installed | grep ^mariadb

Now, I see the following, after I have installed – all MariaDB packages available in my system
mariadb.x86_64 1:5.5.52-1.el7 @local
mariadb-bench.x86_64 1:5.5.52-1.el7 @local
mariadb-devel.x86_64 1:5.5.52-1.el7 @local
mariadb-libs.x86_64 1:5.5.52-1.el7 @anaconda
mariadb-server.x86_64 1:5.5.52-1.el7 @local
mariadb-test.x86_64 1:5.5.52-1.el7 @local

MariaDB Configuration Files
149 ls /etc/my.cnf
150 ls /etc/my.cnf.d/*

The files
/etc/my.cnf.d/client.cnf /etc/my.cnf.d/mysql-clients.cnf /etc/my.cnf.d/server.cnf

153 vim /etc/my.cnf
154 vim /etc/my.cnf.d/client.cnf
155 vim /etc/my.cnf.d/server.cnf
156 vim /etc/my.cnf.d/mysql-clients.cnf
157 main config file /etc/my.cnf

158 grep -v ^# /etc/my.cnf : will show lines that are not comments
159 grep -v ^# /etc/my.cnf

The content of my.cnf : some lines are self explanatory

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0
[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid

MariaDB messages are logged at: /var/log/mariadb/mariadb.log

MySQL Specific Selinux Contexts
171 ps -eZ | grep mysqld
I do not see anything as mysqld/maridb is not running

178 systemctl start mariadb.service
179 systemctl enable mariadb.service
180 ps -eZ | grep mysqld

now the output:
system_u:system_r:mysqld_safe_t:s0 4428 ? 00:00:00 mysqld_safe
system_u:system_r:mysqld_t:s0 4585 ? 00:00:00 mysqld

184 mysqld runs on it’s own domain mysqld_t

Related Selinux file type: mysql_exec_t
etc_t is for /etc/my.cnf.d
mysql_db_t is for /var/lib/mysql/
mysql_log_t is for /var/log/mariadb/
189 ll -dZ /usr/libexec/mysqld /etc/my.cnf.d /var/lib/mysql /var/log/mariadb

The output – please note the Selinux Contexts in the output
drwxr-xr-x. root root system_u:object_r:mysqld_etc_t:s0 /etc/my.cnf.d
-rwxr-xr-x. root root system_u:object_r:mysqld_exec_t:s0 /usr/libexec/mysqld
drwxr-xr-x. mysql mysql system_u:object_r:mysqld_db_t:s0 /var/lib/mysql
drwxr-x—. mysql mysql system_u:object_r:mysqld_log_t:s0 /var/log/mariadb

Corresponding Selinux Port Type: mysql_port_t
196 semanage port -l | grep mysqld
output:
mysqld_port_t tcp 1186, 3306, 63132-63164

Related Selinux Booleans: mysql_connect_any, selinuxuser_mysql_connect_enabled
200 getsebool -a | grep mysql

I see the output
mysql_connect_any –> off
selinuxuser_mysql_connect_enabled –> off

To install MariaDB-Server:
205 yum -y install mariadb-server
already installed. we installed with yum -y install mariadb* [installed everything together]

207 systemctl enable mariadb

We can run mysql_secure_installation – to secure our MariaDB installation
209 mysql_secure_installation

—–

The Output: from mysql_secure_installation command
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we’ll need the current
password for the root user. If you’ve just installed MariaDB, and
you haven’t set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on…

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
… Success!

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
… Success!

Normally, root should only be allowed to connect from ‘localhost’. This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
… Success!

By default, MariaDB comes with a database named ‘test’ that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
– Dropping test database…
… Success!
– Removing privileges on test database…
… Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
… Success!

Cleaning up…

All done! If you’ve completed all of the above steps, your MariaDB


installation should now be secure.
Thanks for using MariaDB!

Enable MariaDB through Firewall and Allow traffic on Port 3306 – default mysql port
218 firewall-cmd –add-service=mysql –perm
220 firewall-cmd –reload

221 systemctl start mariadb
222 systemctl status mariadb
223 start mysql/mariadb

Run MySQL

224 mysql -u root -p

mysqldump is used to backup a database
mysql command can be used to restore a database
you can even use IDEs such as MySQL Workbench to backup and restore MySQL Databases

228 mysql -u root -p
229 mysqldump -u root -p testsayed > testsayeddb.sql

to restore – you need to use < testsayeddb.sql
231 mysql -u root -p testsayed < testsayeddb.sql

Backup and Restore MySQL Database

You can backup multiple databases at once, you can even backup some tables or other database objects using mysqldump

similarly, you can restore multiple databases at the same time using mysql command
just use multiple datbase or database object names with NO comma – one after another

235 mysqldump -u root -p DB1 DB2 DB3 > alldb.sql

when you use restore and give the sql file – if you use db name or table name before < then only that part will be restored irrespective hiow much data is there on the file

example
238 mysql -u root -p DB1 tbl1 < alldb.sql ;

you can use –all-databases or –databases with mysqldump command From: http://sitestree.com/?p=12128
Categories:DevOps, RHCE
Tags:
Post Data:2018-01-03 18:59:06

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

AutoFS and Mounting in Linux/Redhat/CentOS #DevOps #RHCSA

AutoFS and Mounting in Linux/Redhat/CentOS

echo “AutoFS – Automatic FS system Mounting – Dec 26th, 2017 by Sayed”

check if Autofs installed or not
yum list installed | grep autofs

I just installed; hence it is there
you can install with yum -y install autofs

944 yum -y install autofs

then you can enable autofs
946 systemctl status autofs
947 systemctl start autofs
948 systemctl enable autofs

enable – will start this service at reboot/system start

AutoFS in general does not use /etc/fstab
AutoFS uses /etc/mtab file
Also, AutoFS has some files under /etc and starting with auto. You can also define which file will contain the mounting mapping. the file that will act like /etc/fstab for autofs

AutoFS has direct mapping and indirect mapping
let’s see some files under /etc for autofs

955 ls /etc/auto*

The files

/etc/auto.direct /etc/autofs.conf /etc/autofs_ldap_auth.conf /etc/auto.master /etc/auto.misc /etc/auto.net /etc/auto.smb /etc/auto.master.d:

I saw to use /etc/auto.master for configuring which file will do the mapping for direct mounting.
I saw to use /etc/auto.misc for configuring which file will do the mapping for indirect mounting for AutoFS.

One more config file is under: /etc/sysconfig/autofs

961 cat /etc/sysconfig/autofs

the content
#
# Init system options
#
# If the kernel supports using the autofs miscellanous device
# and you wish to use it you must set this configuration option
# to “yes” otherwise it will not be used.
#
USE_MISC_DEVICE=”yes”
#
# Use OPTIONS to add automount(8) command line options that
# will be used when the daemon is started.
#
#OPTIONS=””
#

For mounting NFS i.e. remote/network file-systems/folders – we can use the regular mounting i.e. /etc/fstab and mount command. However, that is kinda manual. We can mount NFS using AutoFS that will be automatic mount

We use AutoFS for LDAP clients to auto mount Users’ home directories. We just configure, then the mounting happens automatically. You remember that getent passwd user-name mounted the remote users’ home directory into local system. we used /etc/auto.master to tell that auto.guests will have the mounting configurations. then on /etc/auto.guests file – we configured that users’ home directories will be mounted on /home/guests. you can check our notes on LDAP client configuration

979 cat /etc/auto.master
980 vim /etc/auto.master

we added the following line on /etc/auto.master
/etc/auto.guests /etc/auto.direct

it just tells that AutoFS will consult /etc/auto.guests file for direct mapping

 

984 vim /etc/auto.guests
we added the following line on /etc/auto.guests
/home/guests 192.168.1.15:/nfsrh

it just tells remote /nfsrh will be automatically mounted to /home/guests
you can try to restart autofs

989 systemctl restart autofs

 

Indirect Map
indirectly mounted points are only visible when accessed
automatically mounts shares under one common parent directory
each indirect map put only one entry in the mtab file
local and indirect maps cannot exist in the same parent directory
for indirect mapping – you use /etc/auto.misc file From: http://sitestree.com/?p=12070
Categories:DevOps, RHCSA
Tags:
Post Data:2017-12-26 15:27:27

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

NTP related commands/Linux #DevOps #RHCSA

598 echo “dec 24th, 2017”
599 echo “NTP Client”
600 yum list ntp
601 yum list installed |grep ntp

602 To activate ntp
603 yum -y install ntp system-config-date
604 cat /etc/ntp.conf
605 grep ^server /etc/ntp.conf

606 systemctl restart ntpd
607 systemctl enable ntpd
608 systemctl start ntpd

609 ntpq -p

612 nmtui
613 ip addr

619 system-config-date
620 system-config-authentication

  From: http://sitestree.com/?p=12062
Categories:DevOps, RHCSA
Tags:
Post Data:2017-12-24 22:27:52

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

Network Interface, Network Clients related Linux/Redhat/CentOS commands #DevOps #RHCSA

echo “Dec 24th, 2017”
532 echo “Basic Networking in Linux”
533 hostname
534 uname -a
535 uname -n
536 cat /etc/hostname
537 nmcli general hostname
538 changing hostname temporarily
539 hostname server10.example.com
540 for permanent change
541 hostnamectl set-hostname server100.example.com
542 or change /etc/hostname file
543 vim /etc/hostname
544 restart systemctl
545 systemctl restart systemd-hostnamed
546 systemctl restart systemd-hostnamed.service
547 echo “IPV4 addresses”
548 ip addr
549 cat /etc/protocols
550 ip neighbor
551 yum install arp*
552 cat /etc/services
553 cat /etc/protocols
554 ip neighbor
555 interface configuration files
556 cat /etc/sysconfig/network-scripts/
557 ll /etc/sysconfig/network-scripts/
558 ll /etc/sysconfig/network-scripts/ifcfg-*
559 you can change parameters for the interface config files
560 ll /etc/sysconfig/network-scripts/ifcfg-ens33
561 cat /etc/sysconfig/network-scripts/ifcfg-ens33
562 name and IP conversion. /etc/hosts – DNS is the system to do this.
563 interface stop and start
564 ifdown ens33; ifup ens33
565 cat /etc/default/grub
566 it used to be eth0 eth1, now default is ens
567 you can change that using some config changes
568 ip
569 nm-connection-editor
570 nm-connection-editor is graphical nmtui is text based – not command line but text based interface
571 nmtui is command line based. nmtui is text-based interface based
572 nmcli
573 nmcli device show
574 nm-connection-editor
586 to set ipv4 address – one example

589 ip addr add 192.168.0.111/24 broadcast 192.168.0.255 dev ens33
590 ip addr
591 ip addr add 192.168.0.111/24 broadcast 192.168.0.255 dev eth1
592 ls
593 systemctl status NetworkManager
594 nmcli con show
595 nmcli dev status
596 exit
597 history From: http://sitestree.com/?p=12059
Categories:DevOps, RHCSA
Tags:
Post Data:2017-12-24 22:13:22

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

Disk/Partition/Logical Volume (LVM) Management related commands in Centos/Redhat Linux #DevOps #RHCSA

echo “Dec 22nd 2017”
321 pvs
322 output
323 PV VG Fmt Attr PSize PFree
324 /dev/sda2 cl lvm2 a– 19.00g 0
325 pvs
326 vgs
327 lsblk
328 vgdisplay
329 vgdisplay | grep “PE Size”
330 PE Size 4.00 MiB
331 vgdisplay > vgdisplay20171222.txt
332 vgdisplay | grep ‘PE Size’> vgdisplay20171222.txt
333 lvs
334 lvs > lvs20171222.txt
335 lvs
336 lvdisplay vg00
337 lvdisplay cl
338 lvdisplay cl > lvdisplaycl.txt
339 lvdisplay /dev/cl
340 lvdisplay /dev/cl/root
341 lsblk
342 lvdisplay /dev/cl/swap
343 lvdisplay /dev/cl/swap > swaplv.txt
344 pvck
345 pvck /dev/sda
346 lsblk
347 pvck /dev/sda2
348 pvs
349 pvs > pvsoutput
350 pvck /dev/sda2
351 echo “physical volume related commands – just the terms”
352 pvck
353 pvcreate
354 pvdisplay
355 pvresize
356 pvmove
357 pvremove
358 pvs
359 pvscan
360 echo “volume group related commands”
361 echo “you create volume groups out of physical volumes”
362 vgch
363 vgck-> checks integrity of volume groups
364 vgck
365 vgcreate : you provide the physical volumes as parameters
366 vgcreate
367 vgdisplay
368 vgextend
369 vgextend -> you can add additional physical volumes to a volume group
370 vgreduce
371 vgreduce : reduce size of a volume group
372 use -L target-size as parameters for vgreduce along with vg name or -L -100m where 100m is the amount to reduce. not the final size
373 vgrename
374 vgremove
375 vgremove -> removes a volume group
376 vgs
377 vgs -> list volume groups
378 vgscan -> scan system find volume groups
379 vgscan
380 vgscan /dev/sda2
381 vgscan
382 echo “Logical Volume related commands”
383 lvcreate
384 lvdisplay
385 lvextend
386 lvreduce
387 lvremove
388 lvrename
389 lvresize
390 lvs
391 lvscan
392 lvm
393 lvscan
394 lvm
395 lsblk | grep vd
396 lsblk | grep sd
397 lvmdiskscan
398 lvscan
399 lvmdiskscan > outputoflvmdiskscan.txt
400 lsblk
401 parted /dev/sdc mkpart primary 1 100m
402 parted /dev/sdc mklabel msdos
403 parted /dev/sdc mkpart primary 1 201m
404 parted /dev/sdc print
405 pvcreate /dev/sdb /dev/sdc1 -v
406 pvcreate /dev/sdb /dev/sdc1 -v > outputofpvcreate
407 lsblk
408 vgcreate vg01 -s 16 /dev/sdb /dev/sdc1 -v
409 cat pvsoutput
410 cat outputofpvcreate
411 vgs vg01
412 vgscan
413 vgdisplay
414 vgdisplay -v
415 vgdisplay -v vg01
416 pvs
417 pvscan
418 pvdisplay /dev/sdb
419 pvdisplay /dev/sdb > pvdisplaydevsdb
420 pvdisplay /dev/vdc1
421 pvdisplay /dev/sdc1
422 lvcreate -n lvol0 -L 600MB vg01 -v
423 lvcreate -n oravol -L 1.3g vg01 -v
424 lvs
425 lvscan
426 lvdisplay
427 lvdisplay /dev/vg01/lvol0
428 lvdisplay /dev/vg01/oravol
429 vgextend vg01 /dev/sdd -v [need to initialize with pvcreate]
430 pvcreate /dev/sdd
431 vgextend vg01 /dev/sdd -v
432 vgs vg01
433 vgscan
434 lvextend /dev/vg01/lvol0 -L 1g -v
435 lvextend /dev/vg01/oravol -L 2g -v
436 lvdisplay oravol0
437 lvdisplay /dev/vg01/oravol
438 vgdisplay -v vg01
439 lvrename /dev/vg01/lvol0 lvolnew -v
440 lvs /dev/vg01/lvolnew
441 lvs
442 lvs | grep lvolnew
443 lvreduce /dev/vg01/lvolnew -L 800m -v
444 lvresize /dev/vg01/lvolnew -L -100m -v
445 lvremove /dev/vg01/lvolnew
446 lvremove -f /dev/vg01/oravol
447 vgdisplay vg01 | grep ‘Cur LV’
448 vgreduce vg01 /dev/sdb /dev/sdc1
449 vgs
450 vgs vg01
451 vgscan
452 lsblk
453 vgdisplay vg01
454 vgdisplay vg01 -v
455 vgremove vg01
456 vgdisplay vg01 -v
457 pvremove /dev/sdb /dev/sdc1 /dev/sdd
458 exit
459 history From: http://sitestree.com/?p=12008
Categories:DevOps, RHCSA
Tags:
Post Data:2017-12-22 11:56:05

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

Redhat/CentOS Linux and Disk/Volume Management. LVM, parted, gdisk, vgcreate, lvcreate and similar #DevOps #RHCSA

Misc related commands from history

[Redhat/CentOS Linux and Disk/Volume Management. LVM, parted, gdisk, vgcreate, lvcreate and similar]

 

fdisk /dev/sdb
93 parted
94 parted /dev/sdb

96 parted /dev/sdb print
97 vi /etc/fstab
98 parted /dev/sdb
99 vi /etc/fstab
100 parted /dev/sdb
101 parted /dev/sdb print
102 gdisk /dev/sdc
103 gdisk -l /dev/sdc
104 fdisk -l /dev/sda
105 gdisk /dev/sdc
106 gdisk -l /dev/sdc
107 gdisk /dev/sdc
108 gdisk -l /dev/sdc
109 yum list installed
110 yum list installed | grep gnome-disk-utility
111 gdisk /dev/sdc
112 gdisk /dev/sdb
113 gdisk -l /dev/sdb
114 fdisk -l /dev/sdb
115 sfdisk -l /dev/sdb
116 fdisk -l /dev/sdb
117 parted
118 parted /dev/sdb
119 parted /dev/sdc
120 gdisk /dev/sdb
121 gdisk /dev/sdc
122 sfdisk /dev/sdc
123 cfdisk /dev/sdc
124 pvs
125 lsblk
126 pvs
127 pvdisplay
128 vgs
129 lvs
130 lsblk
131 lvs -v
132 vgs -v
133 lvdisplay /dev/vg00/root
134 lvmdiskscan
135 gdisk /dev/sdb
136 parted /dev/sdb mklabel msdos
137 parted /dev/sdb mkpart primary 1 1g
138 parted /dev/sdb print
139 pvcreate -v /dev/sdb1 /dev/sdc
140 parted /dev/sdc
141 lsblk
142 pvcreate -v /dev/sdb1 /dev/sdc
143 parted /dev/sdc mklabel msdos
144 pvcreate -v /dev/sdb1 /dev/sdc
145 vgcreate -s 16 vg01 -v /dev/sdb1 /dev/sdc
146 vgs
147 vgdisplay
148 vgs
149 vgscan
150 vgs vg01
151 vgdisplay vg01 -v
152 pvs
153 pvscan
154 pvdisplay
155 pvdisplay /dev/sdb
156 pvdisplay /dev/sdb1
157 lvcreate -L 600 vg01 -v
158 lvcreate -L 1.3g -n oravol vg01 -v
159 lvs
160 lvdisplay /dev/vgo1/lvol0
161 lvdisplay /dev/vg01/lvol0
162 lvdisplay /dev/vg01/oravol
163 lsblk
164 journalctl -xb
165 tail /var/log/messages
166 vi /etc/fstab
167 reboot
168 lsblk
169 pvcreate /dev/sdd
170 vgextend vg01 /dev/sdd -v
171 vgs
172 lvextend -L 1g /dev/vg01/lvol0 -v
173 lvresize -L 2g /dev/vg01/oravol -v
174 vgdisplay -v vg01
175 lvextend -L 3g /dev/vg01/oravol -v
176 vgdisplay -v vg01
177 lvdisplay
178 vgdisplay
179 lvrename /dev/vg01/lvol0 lvolnew
180 vgdisplay
181 vgdisplay -l
182 vgdisplay -v
183 lvrename vg01 lvolnew lvolrenew
184 vgdisplay -v
185 lvreduce -L 800m /dev/vg01/lvolrenew
186 lvreduce -L -200m /dev/vg01/lvolrenew
187 vgdisplay -v
188 lvresize -L +400m /dev/vg01/lvolrenew
189 lvresize -L -400m /dev/vg01/lvolrenew
190 lvreduce -L +200m /dev/vg01/lvolrenew
191 lvextend -L -1g /dev/vg01/oravol -v
192 lvextend -L +1g /dev/vg01/oravol -v
193 lvremove -f /dev/vg01/lvolrenew
194 lvremove -f /dev/vg01/oravol
195 vgreduce vg01 /dev/sdb1 /dev/sdc
196 vgdisplay vg01
197 lsblk
198 vgdisplay
199 vgdisplay -v
200 vgremove vg01
201 pvremove /dev/sdd /dev/sdb1 /dev/sdc
203 history From: http://sitestree.com/?p=12003
Categories:DevOps, RHCSA
Tags:
Post Data:2017-12-21 20:06:35

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

Experiment with Firewalls in Linux (CentOS/RedHat) #DevOps #RHCSA

44 firewall-cmd –state
45 systemctl status firewalld
46 firewall-cmd –reload
47 systemctl restart firewalld.service

systemctl restart firewalld

48 firewall-cmd –get-default-zone
49 firewall-cmd –get-active-zones
50 firewall-cmd –get-zones
51 firewall-cmd –get-zone-of-interface=ens33
52 firewall-cmd –list-all
53 firewall-cmd –list-all-zones
54 firewall-cmd –get-default-zone
55 firewall-cmd –get-active-zones
56 firewall-cmd –list-all
57 firewall-cmd –get-zones
58 firewall-cmd –list-all-zones
59 firewall-cmd –list-all –zone external
60 firewall-cmd –new-zone testzone –perm
61 firewall-cmd –delete-zone testzone –perm
62 firewall-cmd –get-zones
63 firewall-cmd –new-zone testzone –perm
64 firewall-cmd –get-zones
65 cat /etc/firewalld/zones/testzone.xml
66 cat /etc/firewalld/zones/
67 ll /etc/firewalld/zones/
68 cat /etc/firewalld/firewalld.conf
69 firewall-cmd –get-services
70 firewall-cmd –list-services
71 firewall-cmd –list-services –zone internal
72 firewall-cmd –query-service tftp
73 firewall-cmd –query-service ftp

76 firewall-cmd –query-service ssh
77 firewall-cmd –new-service testservice –perm
78 ll /etc/firewalld/services/testservice.xml
79 firewall-cmd –add-service testservice testservice –zone work –perm
80 firewall-cmd –permanent –add-service testservice –zone work
81 firewall-cmd –list-services –zone work
82 firewall-cmd –list-ports
83 firewall-cmd –query-port 53/tcp –zone dmz
84 firewall-cmd –permanent –add-port 53/tcp
85 firewall-cmd –list-ports
86 firewall-cmd –query-port 53/tcp –zone dmz
87 firewall-cmd –query-port 53/tcp From: http://sitestree.com/?p=11980
Categories:DevOps, RHCSA
Tags:
Post Data:2017-12-15 12:47:48

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

Create your own yum repo in Centos/Redhat #DevOps #RHCSA

Yum is a software installation manager for Redhat Linux and Related.

yum is a better tool than rpm.

Here, we will take the rpm packages as come with Redhat/Centos and then we will host those packages on our own Repo Server for yum. i.e. yum will use this Repo to find installers rather than going to the Internet.

Installing Yum Manager

First we have to install and configure ftp.

[if vsftpd is not already installed, use rpm -ivh vsftpd, you need to mount installer dvd and run rpm under Packages folder – or similar]

Check the status of vsftpd
systemctl status vsftpd
systemctl start vsftpd
systemctl enable vsftpd
cd /var/ftp/pub/
pwd
ls -la
df -h (see disks and default mounts)
mount /dev/sr0 /mnt/iso-installer
(mount DVD where the iso of the installer is kept. I was using VMWare Workstation Pro)

Copy installer rpms from .iso to our ftp server
cd /mnt/iso-installer/
ls -la
cd Packages/
cp -v * /var/ftp/pub/
pwd
ls -la

Create the Repo database
We have to create a database based on all these rpm files. This repo database will be queried by yum to find packages and dependencies to install.

rpm -ivh createrepo-0.9.9-26.el7.noarch.rpm (create repo is not installed by default)

createrepo .

Now configure local PC [workstation with our Yum Repo/server under ftp]. We need a file local.repo to point to our yum repo server

ls /etc/yum.repos.d/
cd /etc/yum.repos.d/
pwd
ls -la

[move existing repo files to old directory]
mkdir old
mv *.repo old/

ls -la
touch local.repo

 

[need to configure local.repo]
Try to check any of the existing .repo file and create based on that. A basic config might look like this

[local]
name=local.repo
baseurl=ftp://localhost/pub

If you want to put hostname for your ftp server

vim /etc/hosts
systemctl start vsftpd
systemctl restart vsftpd
ping localhost
ping yumserver
vi /etc/yum.repos.d/local.repo
hostnamectl set-hostname yumserver
cat /etc/hosts
hostnamectl set-hostname yumserver

You might need to run, if you see yum does not work
yum clean
yum clean cache

cd /etc/yum.repos.d/
cat old/CentOS-Base.repo
vim local.repo

Let FTP work through Firewall
firewall-cmd –add-service=vsftpd –perm
firewall-cmd –add-service=ftp –perm
systemctl reload firewalld
systemctl start firewalld
systemctl enable firewalld
vi /etc/yum.repos.d/local.repo

Check if your yum server is working or not

yum repolist
yum install tree

yum repolist enabled
yum repolist all From: http://sitestree.com/?p=11797
Categories:DevOps, RHCSA
Tags:
Post Data:2017-12-04 23:02:34

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

Drupal 8 Beginner: Best Drupal Videos #Drupal

[embedyt] https://www.youtube.com/embed?listType=playlist&list=PLtaXuX0nEZk9MKY_ClWcPkGtOEGyLTyCO&layout=gallery[/embedyt] From: http://sitestree.com/?p=11353
Categories:Drupal
Tags:
Post Data:2017-10-04 18:21:04

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada