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

Cloud Computing Explained | Bangla | TecHubs TV

https://www.youtube.com/watch?v=8GspRQ5k4Yk
You may have heard of the term Cloud Computing. But if you don’t know what exactly is it, then you’re in right place. In this video, I will explain all about cloud …

Cloud Computing Explained | Bangla | TecHubs TV

https://www.youtube.com/watch?v=8GspRQ5k4Yk
You may have heard of the term Cloud Computing. But if you don’t know what exactly is it, then you’re in right place. In this video, I will explain all about cloud …

What is cloud computing ? Cloud computing ki – Bengali Video

https://www.youtube.com/watch?v=AXuwybLaIEE
What is Cloud Computing and how it works in Simple Terms in Bengali with Example? what is cloud computing in simple terms, Cloud Computing – Full Concept …