NTP related commands/Linux

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

 

Network Interface, Network Clients related Linux/Redhat/CentOS commands

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

TCP Wrappers in Linux/CentOS/Redhat/Fedora

TCP Wrappers in Linux/CentOS/Redhat/Fedora

yum info tcp_wrappers

yum install tcp_wrappers-devel.x86_64
506 reboot
507 ifdown ens33
508 ifup ens33
509 yum install tcp_wrappers-devel.x86_64
510 yum -y install tcp_wrappers-devel.x86_64
511 ls /var/ftp/pub/Packages/
512 ls /etc/yum.repos.d/local.repo
513 vim /etc/yum.repos.d/local.repo
514 systemctl status vsftpd
515 systemctl start vsftpd
516 systemctl enable vsftpd
517 yum -y install tcp_wrappers-devel.x86_64
518 cat /etc/hosts.allow
519 cat /etc/hosts.deny
520 two config files as above. hosts.allow will be consulted first and then hosts.deny is consulted
521 the format of the file content: service: user@source pc
522 service examples: All, All Except, sshd, vsftpd, sshd. multiple services can be given in one line with commas
523 user@source pc examples can be: All, just an IP, 192.168.1.1 Local, subnet: 192.168.0.0/24, network address with except host like: 192.168.0 except 192.168.0.25. multiple host can be given – comma separated. user1@192.168.1.1
524 the above content will serve the purpose of the file. if the content is found on the allow file – that services and user and pc will be allowed. if the content is written in the .deny file – corresponding user, service, pc will be denied
525 exit
526 history

SSH/SSHD/OpenSSH in CentOS/Redhat Linux

Experiment with SSH/SSHD/OpenSSH in CentOS/Redhat Linux

Yes, from  my history (Probably a review for the technical people, who already knew these sometimes in the past)

461 echo “dec 24th, 2017”
462 vim /etc/ssh/sshd_config

463 echo “SSH Related Commands”
464 scp -> secure copy
465 tscp -> secure copy for windows
466 sftp -> secure ftp
467 slogin -> secure login – alternative to rlogin
468 ssh -> provides secure telnet, secure rlogin
469 ssh-add -> provides DSA/ECDSA/RSA characteristics to ssh-agent
470 ssh-agent

 

471 ssh-agent output
472 SSH_AUTH_SOCK=/tmp/ssh-DQP6FzPIZvG7/agent.3903; export SSH_AUTH_SOCK;
473 SSH_AGENT_PID=3904; export SSH_AGENT_PID;
474 echo Agent pid 3904;

475 ssh-copy-id -> copy keys to remote system (manual copy is also an option, you can use scp as well)
476 ssh-keygen: generates public and private key

 

477 SSH components: the server with the SSH daemon. The client with scp, sftp, slogin, ssh, ssh-copy-id. and the openssh packgae itself to provide ssh-ketgen and different modules and libraries.
478 ssh-agent : authentication agent that also holds private keys
479 cat /etc/ssh/sshd_config > system wide ssh config file
480 cat /etc/ssh/sshd_config

481 cat /etc/ssh/ssh_config
482 vim /etc/ssh/ssh_config
483 vim /etc/ssh/sshd_config
484 cat /etc/sysconfig/sshd

485 cat /etc/sysconfig/sshd -> server configuration file
486 cat /var/log/secure
487 cat /var/log/secure -> related messages

488 cat /etc/passwd
489 useradd user1
490 passwd user1
491 su user1
492 useradd user100
493 passwd user100
494 su user100

496 ipaddr
497 ip addr
498 nmtui
499 ip addr
500 su user1

501 exit
502 history > ssh_history.txt
503 history

 


 

after switching to user100

 

ssh 192.168.12.45
4 ssh 192.168.12.45 /bin/ls -la

exit


cd ~

14 touch file1
15 scp file1 192.168.12.45:/home/user100
16 sftp 192.168.12.45

Linux: LVM : Logical Volume Manager : Multiple Hard Disk and Partition and Volume Management

On RedHat/Centos Linux – LVM experiments

Concepts to understand:

Physical Volume: Physical Hard Drive or  Partitions in Physical Hard Drive

Physical Extent:  One unit of space usually 4 MB.

Volume Group: One or multiple Physical Volumes can be assigned to a Volume Group

Logical Volume: Logical volumes are created from the volume groups. This is the volume that users interact with. You mount Logical Volume to work with a logical hard drive space (not partition though similar)

Linux Commands to Know:

pvcreate : create  a physical volume. Initialize a physical drive or partition for LVM

vgcreate: create volume group. Parameters: hard drive or partitions

lvcreate: create logical volume from volume group

lvextend: extend a logical volume

lvresize, lvreduce: to resize or to reduce logical volume

lvremove: to remove a logical volume

 

Some experiment:

I added some hard drives using VMWARE.

lsblk
pvcreate /dev/sdb /dev/sdc
vgcreate vg001 /dev/sdb /dev/sdc
lvcreate -L 500M vg001
lsblk
lvcreate -l 100 vg001
lsblk
pvs
pvdisplay
pvdisplay -v
vgcreate -s 8m /dev/sde
lsblk
vgcreate vg002 -s 8m /dev/sdd
pv
pvs
pvdisplay
lvcreate -L 1G vg002
lsblk
lvextend lv001 +100M
lvextend vg001-lvol0 +100M
lvextend /dev/sdb/vg001-lvol0 +100M
lsblk
lvrename vg01 lvol0 lvolnew
lvrename vg001 lvol0 lvolnew
lsblk
lvextend vg001 lvolnew +100M
lvreduce -L 100m /dev/vg001/lvolnew
lsblk
lvreduce -L 300m /dev/vg001/lvolnew
lvreduce -L 50m /dev/vg001/lvolnew
lvresize -L 700m /dev/vg001/lvolnew
lsblk
lvextend vg001 lvolnew +100M
lvextend /dev/vg001/lvolnew +100M
lvextend -L 100m /dev/vg001/lvolnew
lvextend +100m /dev/vg001/lvolnew
lvextend -L 200 /dev/vg001/lvolnew
lvextend -L 200m /dev/vg001/lvolnew
lvextend -l 200 /dev/vg001/lvolnew
lsblk
lvextend -l 210 /dev/vg001/lvolnew
lsblk
lvextend vg001 lvolnew +100M
history
history > history.txt

Centos/Redhat লিনাক্স এ yum ইন্সটলার সার্ভার কিভাবে কনফিগার করবেন

Centos/Redhat লিনাক্স এ yum ইন্সটলার সার্ভার কিভাবে কনফিগার করবেন

Mount Installer ISO

mkdir /mnt/dvd1

mount /dev/sr0 /mnt/dvd1

Check if FTP server is installed

systemctl status vsftpd

systemctl start vsftpd

Install ftp Server. Using rpm as yum is not available yet [default yum needs the internet, kindof]

cd /mnt/dvd1/Packages/

rpm -ivh vsftpd-3.0.2-22.el7.x86_64.rpm

systemctl start vsftpd

systemctl enable vsftpd

Copy rpm installer packages to the FTP server under Packages folder

cp -rv /mnt/dvd1/Packages /var/ftp/pub/

Also, copy the key file for Yum. Key file is to verify the integrity of the packages

cp -rv /mnt/dvd1/RPM-GPG-KEY-CentOS-7 /var/ftp/pub/

mv /var/ftp/pub/RPM-GPG-KEY-CentOS-7 /var/ftp/pub/key

Install Createrepo using rpm -ivh; create repo will help to create package rep database based on the packages on the FTP server

rpm -ivh createrepo-0.9.9-28.el7.noarch.rpm

Create the repp config file on yum server

cd /etc/yum.repos.d/

mkdir old

mv *.repo old/

vim ftp.repo

ftp.repo  file content

 

[ftp]

name=ftp

baseurl=ftp://yumserver/pub/Packages

enabled=1

gpgcheck=1

one line for pointing to the GPG key file – if you want to configure for key based verification

 

Allow ftp over firewall

firewall-cmd –add-service=ftp –perm

systemctl reload firewalld
systemctl restart firewalld

Again Checking if yum works locally on the server

yum repolist all
yum repolist
yum repolist enabled
yum -y install tree
yum clean
yum clean cache
yum -y install tree
yum repolist enabled
yum repolist

Create Installer Repository Data

cd /var/ftp/pub/Packages/

createrepo .

Configure name for the server

hostnamectl set-hostname yumserver

vim /etc/hosts

192.168.1.100 yumserver

192.168.1.200 yumclient

ip addr

ip addr ens33

use nmtui command or ifconfig to set the IP of the server [when required]

you might want to restart the interface

ifdown ens33; ifup ens33

ping yumserver

ping yumclient

before pinging you might want to see if the ping package is installed and if it is blocked or not

Check if yum server works or not

yum install tree

yum -y install lynx


Configure a Client to use your FTP based yum server

Copy the ftp.repo

scp /etc/yum.repos.d/ftp.repo root@yumclient:/etc/yum.repos.d/

For Windows:

tscp /etc/yum.repos.d/ftp.repo root@yumclient:/etc/yum.repos.d/

Check if the client can access your yum server

yum install tree

yum -y install lynx

In Bengali: Some Educational Android Apps on Software/Web Development

Some are in Bengali

Project Management

https://play.google.com/store/apps/details?id=com.sitestree.pmp

On CSS

https://play.google.com/store/apps/details?id=com.sitestree.css

On JavaScript

https://play.google.com/store/apps/details?id=com.sitestree.javascript

 

On PHP

https://play.google.com/store/apps/details?id=com.sitestree.php

 

On SEO course

https://play.google.com/store/apps/details?id=com.sitestree.seo

 

SQL Course

https://play.google.com/store/apps/details?id=com.sitestree.sql

 

Oral Communications

https://play.google.com/store/apps/details?id=com.justetc.oral_communications.workplace

 

AngularJS

https://play.google.com/store/apps/details?id=com.salearningschool.bangla.angularjs1

 

HTML

https://play.google.com/store/apps/details?id=com.salearningschool.bangla.html

lecture 02 object oriented programming in PHP 5

https://www.youtube.com/watch?v=QJSYVubQTfg

object oriented programming in php 5

https://www.youtube.com/watch?v=xVnVD3b2BCc

Introduction to Cloud Computing (Bangla/Bengali)

https://www.youtube.com/watch?v=F9ftalDNOTg