How to Secure SSH Connection | Interview Question for Linux


Q -  How to secure ssh connection ?
Q -  What is a full form of ssh ?
Q -  SSH related Interview Question ?
Q -  What is a default port of SSH ?


ssh, ssh connection, how to secure ssh connection, password less login in linux

SSH is a protocol for securely communicating between computers, SSH stand for Secure Shell and it's work on default 22 port.

We can make secure our ssh connection by following points
  • Always use password less login, login using key authentication 
  • Change default SSH port
  • Disable root login using SSH
Note : Please  suggest more points, type in comment box


Thanks

Your Support is valuable for us so I request you to please comment, share and like this post.

www.linuxtopic.com

How To Configure Bond Interface in CentOS 7 | Network Bonging | Network Timing

Bonding is a method of combining a multiple physical interface into single logical interface. It provide a high availability and redundancy.
bond, bonding, bond interface, network bonding, network timing, bond mode,
tags: bond, bonding, bond interface, network bonding, network timing, bond mode, bond0

How to run cron in every second | Interview Question for Linux Administrator


Question 1: how  to run cron in every second

It's not possible to run cron in every second but we can run cron in every second  using this method, we use a sleep command before the echo date.


how many runlevel in Unix like operating system | runlevel in linux

Question : how many runlevel in Unix like operating system ?
Question : what is runlevel ? 
Question : type of runlevel ?
Question : how to change runlevel in Linux ?
Question : what is a default runleve in linux ? 

how many runlevel in Unix like operating system,  what is runlevel , type of runlevel ?, how to change runlevel in Linux,  what is a default runleve in linux, default runlevel, runlevel, linuxtopic, linux topic, lokesh carpenter

How to Factory Reset IPMI Setting Using Linux Tools | Reset IPMI Password

               
1) How to reset supermicro IPMI ?
2) factory reset ipmi setting ?
3) reset default setting of IPMI ?
4) Reset IPMI IP and admin password ?
5) forget IPMI password, how to reset ?

How to reset supermicro IPMI settings linke IP and password, factory reset ipmi setting, reset default setting of IPMI, Reset IPMI IP and admin password and Reset to the factory default LAN and FRU, how to reset,
Reset IPMI Setting
ipmitool, ipmi, ipmitool commands, ipmi port, ipmi supermicro, ipmiview, ipmiview download, ipmi configuration, ipmi access,

How to Configuration VLAN in Windows | VLAN in Windows

In This topic we will leart to Add VLAN in windows, Configure VLAN in windows 10, add vlan in windows 7, VLAN in window pc, virtual local area connection, VLAN,


We have a realtek ethernet card, if you have other chipset you can search "ethernet diagnostic utility" and install.

Step 1:

Verify Ethernet card :



Step 2

Search and download "realtek ethernet diagnostic utility"


http://www.realtek.com.tw/Downloads/downloadsView.aspx?Conn=4&DownTypeID=3&Langid=1&Level=5&PFid=5&PNid=13

OR

https://az695102.vo.msecnd.net/rtdrivers/cn/nic/0004-Diagnostic_v2.0.3.0_AllInOneRel_0803.zip

VLAN, VLAN configuration in window, vlan tag in window, tag network, configure vlan in window, VLAN in windows


After download extract utility


Go to utility folder and run setup.exe


After successfully installed the utility, open utility

VLAN, VLAN configuration in window, vlan tag in window, tag network, configure vlan in window, VLAN in windows

Find Realtek PCI card and click on it

VLAN, VLAN configuration in window, vlan tag in window, tag network, configure vlan in window, VLAN in windows

Click on “VLAN” and Press Add button

VLAN, VLAN configuration in window, vlan tag in window, tag network, configure vlan in window, VLAN in windows

Enter Vlan ID


Press “Add” button again and confirm by press “Yes”



Virtual LAN created successfully

VLAN, VLAN configuration in window, vlan tag in window, tag network, configure vlan in window, VLAN in windows


Now you can access vlan 122 by configure according to network.


how to redirect systemd logs in to the file

how to redirect systemd logs in to the file

Redirect systemd logs in file

Step 1:

Open service file and update following tags, in this tutorial we use tomcat service.

StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=tomcat

vi  /lib/systemd/system/tomcat.service

[Unit]
Description=Apache Tomcat Web Application Container
After=syslog.target network.target

[Service]
Type=forking

Environment=JAVA_HOME=/usr/lib/jvm/jre
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat
Environment=CATALINE_BASE=/opt/tomcat
Environment='CATALINE_OPTS=-Xms128M -Xmx765M -server -XX:+UseParallelGC'
Environment='JAVA_OPTS=-Djava.awt.haedless=true -Djava.security.egd=file:/dev/./urandom'

ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/bin/kill -15 $MAINPID

User=tomcat
Group=tomcat

StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=tomcat


[Install]
WantedBy=multi-user.target

Step 2:

Create file in rsyslog.d directory in any name

vi /etc/rsyslog.d/tomcat.conf

if $programname == 'tomcat' then /var/log/tomcat/file.log
& stop

Step 3:

Restart rsyslog and tomcat

systemctl  daemon-reloadsystemctl restart rsyslog tomcat

Step 4: 

Check log file
cat  /var/log/tomcat/file.log

Thanks,

Please share and like if this article is helpful 
 

Configure yum server in centos 7 | step by step yum repository | linux package manager

YUM (Yellowdog Updater Modified) is an open source package management tool for RPM (RedHat Package Manager) based Linux systems. It allows  to easily install, update, remove or search software packages on a systems.

OS        -    CentOS 7
IP        -    172.17.20.110
Package    -    Createrepo        

Step 1

Install Createrepo Package :

yum install createrepo httpd

yum server, yum repo server, yum repository server, update yum server, update yum server, update yum repository, update yum, createrepo, yum server tutorial


Step 2

Copy ISO file of CentOS 7 everything OR download from internet it’s approx 6-7GB.

Note : - In this tutorial we used a CentOS 7 64bit Minimal and copy in “iso” directory

ls  /iso


Create repo directory - select name according to your project

mkdir  /var/www/html/linuxtopic


Step 3

Mount CentOS 7 ISO

mount -o loop /iso/CentOS-7-x86_64-Minimal-1708.iso

yum server, yum repo server, yum repository server, update yum server, update yum server, update yum repository, update yum, createrepo, yum server tutorial

cd /mntls


Copy Packages in repo directory

rsync -av  /mnt/Packages/   /var/www/html/linuxtopic/


Step 4

Generate yum repository

createrepo /var/www/html/linuxtopic

yum server, yum repo server, yum repository server, update yum server, update yum server, update yum repository, update yum, createrepo, yum server tutorial

Your repo generated successfully , you can check repodata folder

ls -l /var/www/html/linuxtopic/repodata/


Restart  httpd server

systemctl restart httpdSystemctl status httpd


Step 5

Go to  Client and  Add repo entry in yum.repo.d, create any file add following entry

vi /etc/yum.repos.d/linuxtopic.repo

[linuxtopic]                  
name=linuxtopic yum repo      
baseurl=http://172.17.20.110/linuxtopic    


enabled=1          
gpgcheck=0

[linuxtopic]                        =    Repository name

baseurl=http://172.17.20.110/linuxtopic     =    base url of yum server

enabled=1                       =    1 = enable / 0= disable

gpgcheck=0                    =    0 = disable / 1 =  enable

Step 6

Install Package

yum clean expire-cache ; sudo yum --disablerepo="*" --enablerepo="linuxtopic" install  package-name
Ex
yum clean expire-cache ; sudo yum --disablerepo="*" --enablerepo="linuxtopic" install  chrony


Step 7

Update yum repository

Download / copy rpm package in  /var/www/html/linuxtopic directory

yum --downloadonly --downloaddir=/var/www/html/linuxtopic/ vim*


Update Repository

createrepo --update /var/www/html/linuxtopic



Thanks,

Please share, like and follow us

yum repo updating using bash script in CentOS 7 | yum server update


This is a bash script for update yum repository. This script will work if new RPM packages found in repository folder. There is no required to manual to update repository for new package. Just create script and set cron.


how to configure samba | step by step samba configuration in Ubuntu 16.4

Q1 - Step by Step Samba server Configuration ?
Q2 - how to configure samba public and secure ?
Q3 - access samba server in windows ?
Q4 - Access Samba in Linux ?
Q5 - Public and Protected Samba sharing ?

step by step configure pxe boot server in Centos 7 | PXE network boot server | pxe boot

PXE stand for Preboot eXecution Environment it works on Client-Server architecture and allows unattended or automated OS installation over the Network

Point to be noted :

This PXE Boot server configuration in Ubuntu 16.4,  
PXE network boot server with Configure dnsmasq with DHCP and dnsmasq without dhcp,
pxe boot server we add centos 7 boot entry in default pxelinux.cfg directory via NFS and http, 
We configure pxe boot with clonezilla iso and zip
CentOS iso pxeboot entry, Installing CentOS, Debian using network booting

Server IP = 172.17.20.100
Host name = pxe.linuxtopic.com
OS = CentOS 7

Step 1:

Install required packages

yum install tftp-server syslinux dnsmasq

configure pxe boot server, clonezilla, pxeboot server, network boot, network booting, pxe, boot from network, boot on network, network boot linux, network boot server, network boot windows 10, network boot ubuntu, network boot windows 7, network boot windows 7 diskless, how does pxe boot work, pxe boot server windows


Step 2:

Configure dnsmasq
cp /etc/dnsmasq.conf /etc/dnsmasq.conf-bk
Option 1 :  Configure dnsmasq as existing dhcp on network

vi /etc/dnsmasq.conf

# DNS Options
port=0
interface=eth0,lo


# DHCP Options
dhcp-range=172.17.0.1,proxy
dhcp-option=vendor:PXEClient,6,2b
dhcp-no-override


# PXE
dhcp-boot=pxelinux.0


#pxe-prompt="Press F8 for menu.", 10
pxe-service=X86PC, "www.linuxtopic.com", pxelinux


# TFTP Options
enable-tftp
tftp-root=/var/lib/tftpboot

configure pxe boot server, clonezilla, pxeboot server, network boot, network booting, pxe, boot from network, boot on network, network boot linux, network boot server, network boot windows 10, network boot ubuntu, network boot windows 7, network boot windows 7 diskless, how does pxe boot work, pxe boot server windows

Option 2 :  Configure dnsmasq with dhcp server

# DNS Options
port=0
interface=eth0,lo


# DHCP range-leases
dhcp-range= eth0,172.17.20.200,172.17.20.250,255.255.0.0,1h
# Gateway
dhcp-option=3,172.17.20.100
# DNS
dhcp-option=6,172.17.120.100, 8.8.8.8
# Broadcast Address
dhcp-option=28,172.17.255.255
# NTP Server
dhcp-option=42,0.0.0.0


# PXE
dhcp-boot=pxelinux.0
pxe-service=x86PC, "Linuxtopic.com", pxelinux


# Enable TFTP
enable-tftp
tftp-root=/var/lib/tftpboot

configure pxe boot server, clonezilla, pxeboot server, network boot, network booting, pxe, boot from network, boot on network, network boot linux, network boot server, network boot windows 10, network boot ubuntu, network boot windows 7, network boot windows 7 diskless, how does pxe boot work, pxe boot server windows

Explain :


port=0   -  disable dns
interface=eth0,lo   - Interfaces that the server should listen and provide services


dhcp-rang=172.17.20.100,proxy   -  existing dhcp server ip  
OR
dhcp-range= eth0,172.17.199.200,172.17.199.250,255.255.0.0,1h  - Dhcp IP Range
dhcp-option=3,172.17.199.199  - define gateway
dhcp-option=6,172.17.199.199, 8.8.8.8  - Define DNS
dhcp-option=28,172.17.255.255  - Broadcast Address
dhcp-option=42,0.0.0.0 - NTP Server


dhcp-option=vendor:PXEClient,6,2b    - download the boot file immediately by disable multicast and broadcast discovery.
dhcp-boot=pxelinux.0    -
pxe-service=X86PC, "www.linuxtopic.com", pxelinux    -  Use x86PC for 32-bit/64-bit architectures and enter a menu description prompt under string quotes. Other values types can be: Intel_Lean_Client, IA32_EFI, _EFI, Alpha, Arc_x86, BC_EFI, Xscale_EFI and X86-64_EFI, PC98, IA64
enable-tftp    -  Enables the build-in TFTP server.
tftp-root=/var/lib/tftpboot   -  the location for all netbooting files.

Video Tutorial In Hindi 


Video Tutorial In Hindi 




Step 3:  

Create directory and copy required file

mkdir /var/lib/tftpboot/pxelinux.cfg

cp -v /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot

cp -v /usr/share/syslinux/menu.c32 /var/lib/tftpboot

cp -v /usr/share/syslinux/memdisk /var/lib/tftpboot

cp -v /usr/share/syslinux/mboot.c32 /var/lib/tftpboot

cp -v /usr/share/syslinux/chain.c32 /var/lib/tftpboot

cp -v /usr/share/syslinux/vesamenu.c32 /var/lib/tftpboot/

ls -l /var/lib/tftpboot/


Step 4:

Create default  file and add menu entry

vi /var/lib/tftpboot/pxelinux.cfg/default

default vesamenu.c32
prompt 0
timeout 50


# Local Hard Disk pxelinux.cfg default entry
LABEL 1
   MENU LABEL ^1) Boot local hard drive
   MENU AUTOBOOT
   MENU DEFAULT
   LOCALBOOT 0

configure pxe boot server, clonezilla, pxeboot server, network boot, network booting, pxe, boot from network, boot on network, network boot linux, network boot server, network boot windows 10, network boot ubuntu, network boot windows 7, network boot windows 7 diskless, how does pxe boot work, pxe boot server windows

Step 5:  

Download Clonezilla zip File from official website and extract

https://clonezilla.org/downloads/download.php?branch=stable



Create Directory and Copy clonezilla zip

mkdir /var/lib/tftpboot/clonezilla
cd  /var/lib/tftpboot/clonezilla
unzip clonezilla-live-2.5.5-38-amd64.zip

Add  Clonezilla menu entry in  pxelinux.cfg/defalut

vi /var/lib/tftpboot/pxelinux.cfg/default

# Clonezilla pxelinux.cfg default entry
LABEL 2
   MENU LABEL ^2) Clonezilla Live
   KERNEL clonezilla/live/vmlinuz
   APPEND ramdisk_size=32768 initrd=clonezilla/live/initrd.img boot=live union=overlay username=user config components noswap edd=on nomodeset noeject locales=en_US.UTF-8 keyboard-layouts=NONE net.ifnames=0 ocs_live_extra_param="" ocs_live_keymap="NONE" ocs_live_batch="yes" ocs_lang="en_US.UTF-8" vga=788 ip=frommedia nosplash  fetch=tftp://172.17.20.100/clonezilla/live/filesystem.squashfs

Centos 7 pxelinux.cfg default boot entry

Download / Copy CentOS 7 ISO in pxe boot server  and mount on /mnt:

mount -o loop /tmp/CentOS-7-x86_64-Minimal-1708.iso /mnt/

Create Folder

mkdir /var/lib/tftpboot/data/centos7_64Bit

Note: If you want to install CentOS 32 bit edition, make a relevant directory called centos7_32Bit (Ex. /var/lib/tftpboot/data/centos7_32Bit).

Copy the ISO file contents to /var/lib/tftpboot/data/centos7_64Bit

cp -fr /mnt/* /var/lib/tftpboot/data/centos7_64Bit/

Set the proper permissions to the above directory.

chmod -R 755 /var/lib/tftpboot/data

Access data for Installation :

Option 1 : NFS Server

yum install nfs-server

echo "/var/lib/tftpboot/data  *(rw)" >> /etc/exports


restart service

systemctl restart nfs-serversystemctl enable nfs-server

Check nfsmount

showmount -e 172.17.20.100


Option 2 : HTTP Server

yum install httpd

Create a apache configuration file for PXE server under /etc/httpd/conf.d/ directory:

cat > /tmp/pxeboot.conf << EOFAlias /pxeboot /var/lib/tftpboot/data<Directory /var/lib/tftpboot/data>Options Indexes FollowSymLinksRequire all granted</Directory>EOF


systemctl disable firewalldsystemctl stop firewalld
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/sysconfig/selinux
systemctl restart httpdsystemctl enable  httpd


Now test http by access url



Add  Centos 7  menu entry in  pxelinux.cfg/defalut

vi /var/lib/tftpboot/pxelinux.cfg/default

# CentOS 7 pxelinux.cfg default entry
LABEL 3
   MENU LABEL ^3) Install CentOS 7 - NFS
   kernel data/centos7_64Bit/images/pxeboot/vmlinuz
   append initrd=data/centos7_64Bit/images/pxeboot/initrd.img inst.stage2=nfs:172.17.20.100:/var/lib/tftpboot/data/centos7_64Bit quiet


# CentOS 7 pxelinux.cfg default entry
LABEL 4
   MENU LABEL ^4) Install CentOS 7 - HTTP
   KERNEL data/centos7_64Bit/images/pxeboot/vmlinuz
   APPEND initrd=data/centos7_64Bit/images/pxeboot/initrd.img method=http://172.17.20.100/pxeboot/centos7_64Bit devfs=nomount

configure pxe boot server, clonezilla, pxeboot server, network boot, network booting, pxe, boot from network, boot on network, network boot linux, network boot server, network boot windows 10, network boot ubuntu, network boot windows 7, network boot windows 7 diskless, how does pxe boot work, pxe boot server windows

Restart DNSMASQ

systemctl restart dnsmasqsystemctl enable dnsmasq

Option 3: FTP Server

yum install vsftpd
Configure vsftpd
vi /etc/vsftpd/vsftpd.conf
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=YES
#
# Uncomment this to allow local users to log in.
# When SELinux is enforcing check for SE bool ftp_home_dir
local_enable=NO
#
# Uncomment this to enable any form of FTP write command.
write_enable=NO

# Activate logging of uploads/downloads.
xferlog_enable=YES

# When "listen" directive is enabled, vsftpd runs in standalone mode and
# listens on IPv4 sockets. This directive cannot be used in conjunction
# with the listen_ipv6 directive.
listen=NO

# Add This in bottom
anon_root=/var/lib/tftpboot/data
anon_max_rate=2048000

systemctl restart vsftpdsystemctl enable vsftpd
Add  Centos 7  menu entry in  pxelinux.cfg/defalut

vi /var/lib/tftpboot/pxelinux.cfg/default

# CentOS 7 pxelinux.cfg default entry
LABEL 5
MENU LABEL ^5) Install CentOS 7 - FTP
KERNEL data/centos7_64Bit/images/pxeboot/vmlinuz
APPEND initrd=data/centos7_64Bit/images/pxeboot/initrd.img  inst.repo=ftp://172.17.20.100:/centos7_64Bit 

 configure pxe boot server, clonezilla, pxeboot server, network boot, network booting, pxe, boot from network, boot on network, network boot linux, network boot server, network boot windows 10, network boot ubuntu, network boot windows 7, network boot windows 7 diskless, how does pxe boot work, pxe boot server windows

Now PXE Boot Server is Ready - Go to client side and Select first boot device "Network" in BIOS setting