Trilha (Linux Tools): Usando o Cockpit no Centos 7

Hoje trazendo uma ferramenta que pode ajudar você na administração do seu servidor usando o modo gráfico, sem a necessidade de instalar um ambiente gráfico no servidor (Gnome), por exemplo. É possível gerenciar redes, storages, contas de usuários, entre outros recursos do seu sistema, tudo pelo ambiente gráfico.

# yum install cockpit -y
# systemctl status cockpit
# systemctl start cockpit
# !264
systemctl status cockpit
● cockpit.service - Cockpit Web Service
Loaded: loaded (/usr/lib/systemd/system/cockpit.service; static; vendor preset: disabled)
Active: active (running) since Qui 2020-05-28 17:39:22 -03; 33s ago
Docs: man:cockpit-ws(8)
Process: 4203 ExecStartPre=/usr/sbin/remotectl certificate --ensure --user=root --group=cockpit-ws --selinux-type=etc_t (code=exited, status=0/SUCCESS)
Main PID: 4205 (cockpit-ws)
CGroup: /system.slice/cockpit.service
└─4205 /usr/libexec/cockpit-ws
Mai 28 17:39:22 centos1 systemd[1]: Starting Cockpit Web Service...
Mai 28 17:39:22 centos1 systemd[1]: Started Cockpit Web Service.
Mai 28 17:39:22 centos1 cockpit-ws[4205]: Using certificate: /etc/cockpit/ws-certs.d/0-self-signed.cert
#!/usr/bin/env bash
# ------------------------------------------------------------------------ #
# Script Name: firewalld.sh
# Description: Firewalld service management
# Site: https://medium.com/@amaurybsouza
# Written by: Amaury Souza
# Maintenance: Amaury Souza
# ------------------------------------------------------------------------ #
# Usage:
# $ ./firewalld.sh
# ------------------------------------------------------------------------ #
# Tested on:
# Bash 4.2.46
# ------------------------------------------------------------------------ #
# History: v1.0 25/05/2020, Amaury:
# - Start the program
# - Add case feature
# v1.1 25/05/2020, Amaury:
# - Adding new variables
# v1.2 25/05/2020, Amaury:
# - Executing new tests in my system
# ------------------------------------------------------------------------ #
# Thankfulness:
#
# ------------------------------------------------------------------------ #
#VARIABLES --------------------------------------------------------------- #STATUS=`systemctl status firewalld | grep -i "running" | cut -d " " -f 4,5,6`
START=`systemctl start firewalld`
SHOW=`firewall-cmd --list-all | grep -i "services"`
RELOAD=`firewall-cmd --reload`
#CODE -------------------------------------------------------------------- #clear
while true;do
echo " "
echo "Welcome at $0"
echo " "
echo "Choose a option below to start!
1- ensure firewalld service is installed
2- show firewalld status
3- start firewalld service
4- show available rules
5- add new rules
6- reload firewalld service
0- Exit script"
echo " "
echo -n "selected option: "
read option
case $option in
1)
if [ -x `command -v firewalld` ]
then
echo " "
echo "Installed and latest version"
sleep 2
echo " "
else
echo "Not installed yet"
sleep 2
echo " "
fi
;;
2)
echo " "
echo "Firewalld status: $STATUS"
;;
3)
echo "Starting service..."
sleep 2
echo "$START"
;;
4)
echo -n "Rules available... $SHOW"
echo " "
;;
5)
echo -n "Type a rule: "
read rule
if [ -z $rule ]
then
echo "You don't type nothing"
else
echo -n "Your rule: $rule"
echo " "
firewall-cmd --add-service=$rule --permanent
fi
echo
;;
6)
echo "Reloading..."
sleep 2
echo "$RELOAD"
;;
*)
echo "invalid option, please, try again!"
;;
esac
done
#END ------------------------------------------------------------------ #
Welcome at ./firewalld.sh

Choose an option below to start!
1- ensure firewalld service is installed
2- show firewalld status
3- start firewalld service
4- show available rules
5- add new rules
6- reload firewalld service
0- Exit script

selected option: 5
Type a rule: cockpit
Your rule: cockpit
Warning: ALREADY_ENABLED: cockpit
success
https://192.168.10.25:9090/
Cockpit
Cockpit screen
Cockpit accounts
Criando nova conta
Dados da conta de usuário
Foo user (Cockpit tool)
# yum install cockpit-storaged.noarch -y
# yum search cockpit
Plugins carregados: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.ufscar.br
* extras: mirror.ufscar.br
* updates: mirror.ufscar.br
============================================================ N/S matched: cockpit ============================================================
cockpit-bridge.x86_64 : Cockpit bridge server-side component
cockpit-composer.noarch : Composer GUI for use with Cockpit
cockpit-dashboard.x86_64 : Cockpit remote servers and dashboard
cockpit-doc.x86_64 : Cockpit deployment and developer guide
cockpit-docker.x86_64 : Cockpit user interface for Docker containers
cockpit-kubernetes.x86_64 : Cockpit user interface for Kubernetes cluster
cockpit-machines.x86_64 : Cockpit user interface for virtual machines
cockpit-machines.noarch : Cockpit user interface for virtual machines
cockpit-machines-ovirt.noarch : Cockpit user interface for oVirt virtual machines
cockpit-packagekit.x86_64 : Cockpit user interface for package updates
cockpit-packagekit.noarch : Cockpit user interface for packages
cockpit-pcp.x86_64 : Cockpit PCP integration
cockpit-storaged.noarch : Cockpit user interface for storage, using udisks
cockpit-subscriptions.noarch : Cockpit subscription user interface package
cockpit-system.noarch : Cockpit admin interface package for configuring and troubleshooting a system
cockpit-tests.x86_64 : Tests for Cockpit
cockpit-ws.x86_64 : Cockpit Web Service
cockpit-ws.i686 : Cockpit Web Service
subscription-manager-cockpit.noarch : Subscription Manager Cockpit UI
cockpit.x86_64 : Web Console for Linux servers

Passion for DevOps