Sv translation |
---|
|
Azure CloudFor the Azure Cloud, you specify a user during the basic installation. The root password remains hidden. However, you can switch to root with the following command, the input of your own password is required: |
Folgende Schritte werden direkt nach der Grundinstallation durchgeführt, bevor eine bestimmte Rolle des Servers konfiguriert wird.
Firewall Konfiguration
Umhängen der Netzwerkkarte in die Zone private
Da manche Firewall-Regeln auf die Zone Privat anzuwenden sind, sollte die entsprechende Netzwerkkarte in diese Zone umgehängt werden.
Für den Fall dass beide Netzwerkkarten privat sind, können natürlich beide umgehängt werden.
...
| Firewall - Konfiguration der Netzwerkkarte als privat
Furthermore, it is necessary to assign the network card(s) to a zone. This is done by editing the network configuration: Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Netzwerkeinstellungen Azure Cloud |
---|
| vi /etc/sysconfig/network-scripts/ifcfg- |
| ens160
ZONE=internal |
...
(add at end)
ZONE=public
...
service network restart |
|
System updateSystem aktualisieren und erste Pakete installieren
Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Update and Installation |
---|
| yum -y update
yum -y install nano unzip ntp ntpdate wget man openssh-clients rsync screen sysstat nfs-utils cifs-utils policycoreutils-python yum-plugin-versionlock |
|
|
Reboot
Grundkonfiguration
User jtel erzeugen
Die nachfolgende Befehle erzeugen den Benutzer jtel
, fügen ihn der Gruppe wheel
zu und geben ihm das Passwort fireball
:
Code Block |
---|
language | bash |
---|
title | jtel Benutzer |
---|
|
useradd -m jtel
gpasswd -a jtel wheel
printf 'fireball\nfireball\n' | passwd jtel |
SSH Schlüssel eintragen
Als nächstes werden die SSH-Schlüssel der jtel-Projekt-Techniker eingetragen, so dass ein gesichertes Login ohne separate Passworteingabe möglich wird. Standardmäßig existiert im Home-Verzeichnis von root
weder das SSH-Konfigurationsverzeichnis noch die entsprechende Konfigurationsdatei. Dies alles wird mit den Befehlen im Nachfolgenden Code-Block erzeugt:
Code Block |
---|
language | bash |
---|
title | SSH Keys |
---|
|
mkdir -p /home/jtel/.ssh
cat << EOFF > /home/jtel/.ssh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G2nbWbWWLFSQncT6bCOKuiNZKPnCVttWXCcufzRPXLMXE+GnSe7cQJv5R6Oknrb6UitSUCAhNeZYujhpi1yzoU8xjs8VmY3b1aZZe4PHbDQJzyw8PuCeJyHIsll+Ec3cjR5Ul/7j90rY3TPiISHF6ltp3akKo8zZVEg86ytWhneC2Q== roman.reznik@jtel.de
EOFF
restorecon -R -v /home/jtel/.ssh
chown -R jtel:jtel /home/jtel/.ssh
chmod 0700 /home/jtel/.ssh
chmod 0644 /home/jtel/.ssh/authorized_keys |
Hinweis: alle anderen SSH keys nicht mehr verwenden.
Damit diese auch korrekt funktionieren, müssen die SELINUX-Security-Labels korrekt angepasst werden. Dies erledigt der Befehl am Ende des Code-Blocks.
History Funktion verbessern
Der Nachfolgende Befehl generiert eine Konfigurationsdatei zur Verbesserung der History-Funktion der Shell:
Code Block |
---|
language | bash |
---|
title | History Funktion |
---|
|
cat <<EOFF > ~/.inputrc
"\e[A": history-search-backward
"\e[B": history-search-forward
set show-all-if-ambiguous on
set completion-ignore-case on
EOFF |
Screen Multiplexer verbessern
Der Nachfolgende Befehl verbessert die Darstellung des screen-Multiplexers.
Code Block |
---|
language | bash |
---|
title | Screen Multiplexer |
---|
|
cat <<EOFF >> /etc/screenrc
# JTEL:Added
startup_message off
vbell off
hardstatus alwayslastline "%{kw} %{b}%H%{K} < %-w%{Wb} %n %t %{-}%+w >"
# This lets work all functions keys in midnight commander
# termcapinfo xterm 'k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~'
EOFF
|
Wheel (sudo) Konfiguration
Der Nachfolgende Befehl erzeugt eine Konfigurationskomponente, um den Benutzern der Gruppe wheel
das Recht zu geben, Befehle als root
mittels des Tools sudo
auszuführen:
Code Block |
---|
language | bash |
---|
title | Sudo Berechtigung |
---|
|
cat <<EOFF > /etc/sudoers.d/wheelers
## Allows people in group wheel to run all commands
%wheel ALL=(ALL) ALL
EOFF
|
Shell Konfiguration auf jtel übertragen
Die nachfolgende Befehle replizieren die Shell-Konfiguration vom Benutzer root
in den Benutzer jtel
:
Code Block |
---|
language | bash |
---|
title | Konfiguration jtel Benutzer |
---|
|
cp -a /root/.inputrc /home/jtel
chown -R jtel:jtel /home/jtel/.inputrc
|
SSH Keys auf root übertragen
Die nachfolgende Befehle replizieren die SSH Keys vom Benutzer jtel
in den Benutzer root
:
Code Block |
---|
language | bash |
---|
title | Konfiguration jtel Benutzer |
---|
|
cp -a /home/jtel/.ssh /root
chown -R root:root /root/.ssh |
NTP auf PTB einstellen
Die nachfolgende Befehle tragen die offiziellen Zeitserver der Physikalisch-Technischen-Bundesanstalt in die Konfigurationsdatei des Zeitsynchonisationsdienstes ein, konfigurieren den Dienst so, dass er automatisch startet, synchronisieren die Zeit einmalig mit einem der PTB-Server und starten den Dienst.
Code Block |
---|
language | bash |
---|
title | Zeitsynchonisation |
---|
|
sed -i -e "s/^server 0.centos.pool.ntp.org iburst$/server ptbtime1.ptb.de\nserver ptbtime2.ptb.de\nserver ptbtime3.ptb.de\nserver 0.centos.pool.ntp.org iburst/" /etc/ntp.conf
chkconfig ntpd on
ntpdate ptbtime2.ptb.de
service ntpd start
|
NTP Prüfen
Siehe hier:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/s1-Checking_the_Status_of_NTP.html
für eine Erklärung.
Code Block |
---|
language | bash |
---|
title | Zeitsyncrhonisation prüfen |
---|
|
ntpq -p |
Deinstallation anacron, Installation cron
Da der anacron Dienst stehen bleibt, wenn einer der Wartungsskripte nicht durchläuft, wird dieser deinstalliert, und der cron dienst installiert:
Code Block |
---|
language | bash |
---|
title | Deinstallation anacron, Installation cron |
---|
|
sudo yum -y install cronie-noanacron
sudo yum -y remove cronie-anacron |
VMWare / Hyper-V / Virtualisierungs-Tools
VMWare Tools installieren
Code Block |
---|
language | bash |
---|
title | VMWare Tools Installieren |
---|
|
yum -y install open-vm-tools |
Hyper-V / Andere Virtualisierungsumgebungen
yum-utils nmap bind-utils tcpdump lsof tmux tmpwatch
yum -y install https://repo.ius.io/ius-release-el7.rpm
yum -y install epel-release
# LAG: NO LONGER NEEDED
# Removed 17.09.2018 after feedback from FK
# yum -y install http://mirror1.hs-esslingen.de/repoforge/redhat/el7/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
# yum-config-manager --enable rpmforge-extras |
|
Reboot disable ipv6
Warning |
---|
| If the yum update fails because of IPv6, ipv6 can be disabled. |
Translations Ignore |
---|
Code Block |
---|
| vi /etc/sysctl.d/disable-ipv6.conf
# Add the following lines
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
# Then issue the following command
sysctl -p
# Then edit yum.conf
vi /etc/yum.conf
# Add the following line
ip_resolve=4
# Then reboot
reboot |
|
Basic configurationMake sure firewalld is running (Required for Azure Cloud installation) The following commands ensure that firewalld is running. Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | firewalld configuration |
---|
| systemctl disable iptables
systemctl mask iptables
systemctl enable firewalld
systemctl start firewalld
|
|
Create User jtel The following commands create the user jtel , add it to the group wheel and give it the password <password> : Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | jtel User |
---|
| useradd -m jtel
gpasswd -a jtel wheel
printf '<password>\n<password>\n' | passwd jtel |
|
Enter SSH key Next, the SSH keys of the jtel project technicians are entered so that a secure login is possible without separate password entry. By default, neither the SSH configuration directory nor the corresponding configuration file exists in root 's home directory. All this is generated with the commands in the following code block: Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | SSH Keys |
---|
| mkdir -p /home/jtel/.ssh
cat << EOFF > /home/jtel/.ssh/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAgJWox9vkWssx24V6m+VB/9cfFUznUnVJqHeSnQFcE+ANzH+lgv90jQYXRf8XLSaKA4HZGO7SFUwLz7eNHk0lIS+TG+WKGrjl3GRvzNoYVAapeKUV7HjbeagQPNOCKTr6G8Vi/GVMyOx8XhJAgpr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de
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAilON3Cn1bZPBYtv67Bv63llD1KMTTH52/ioPLm+qYYDV80mSHSb+PHD9awXNKNv5iTecaQ/a56CkK0z+KI5zvJb3EiRZaRe70cIqdflHmTcasVPVk1hAma5xc5UOCr+dKokqMQGwpDRrDvdS3atflQznvlR8+qoxPjlKC4KDx0GOUeSOIPBO6DdYGPlFX6ohMVRE7p/vHIRAOfehmG1xFtfk+rGPmgiblPWWWklKYQUfMnHI0pqFJwrPW46nqdUlQwtknATZC2cuKe931zstFhuDsm218yS4hTTlcjw5i/DH7PFr9Y58BtY6ZTy8khwTUeMPpSxE7i2WYoqoJ7DXcw== sou@jtel.de
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEA0czZLbpaxo/EY9iHDq9n6EWTALeYB7GVmp/mLwp66zeV4DbvTm+3FDUJSD9rqMJzJkAAEicFe+II/ZdIeZzG4JdYf66M/Y6k0w0Y8jJqDtsdgUf3OJ1hJ53Z+BwFqy1vD/a7N2hxlEKD2rzyAfVb+xzTzhJTjpX1kNiUxDMXRZs4ytW0CbOqZSpTJ3eT9NS9gH188KFTvHN8rPzDAxRKcexO2fSzNa7e+dYsfImOQoYlxFBX5YU74Ay9F5b7K95Cxe8EstvKNVmjkNWgnNWuS2d7eabepC1jv3z0FdOGiVoZ1SDgqKz8ysBa6Rzkt5L5peHYAKyH8TedeUk7kRIwZQ== dhia@jtel.de
EOFF
restorecon -R -v /home/jtel/.ssh
chown -R jtel:jtel /home/jtel/.ssh
chmod 0700 /home/jtel/.ssh
chmod 0644 /home/jtel/.ssh/authorized_keys |
|
Note: do not use all other SSH keys. In order for these to function correctly, the SELINUX security labels must be adapted correctly. This is done by the command at the end of the code block. Improve history function The following command generates a configuration file to improve the history function of the shell: Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | History Function |
---|
| cat <<EOFF > ~/.inputrc
"\e[A": history-search-backward
"\e[B": history-search-forward
set show-all-if-ambiguous on
set completion-ignore-case on
EOFF |
|
Improve Screen Multiplexer The following command improves the display of the screen multiplexer. Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Screen Multiplexer |
---|
| cat <<EOFF >> /etc/screenrc
# JTEL:Added
startup_message off
vbell off
hardstatus alwayslastline "%{kw} %{b}%H%{K} < %-w%{Wb} %n %t %{-}%+w >"
# This lets work all functions keys in midnight commander
# termcapinfo xterm 'k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~'
EOFF
|
|
Wheel (sudo) Configuration The following command creates a configuration component to give users of the wheel group the right to execute commands as root using the sudo tool: Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Sudo Authorisation |
---|
| cat <<EOFF > /etc/sudoers.d/wheelers
## Allows people in group wheel to run all commands
%wheel ALL=(ALL) ALL
EOFF
|
|
Transfer shell configuration to jtel The following commands replicate the shell configuration from the root user to the jtel user: Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Configuration jtel User |
---|
| cp -a /root/.inputrc /home/jtel
chown -R jtel:jtel /home/jtel/.inputrc
|
|
Root hint for GIT The following commands make it more difficult to execute GIT as root, since this should always be done in the context of the jtel user: Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | root Warning for GIT |
---|
| cat <<EOFF >> ~/.bashrc
alias git='printf "It looks like you are trying to run GIT as ROOT.\nFor jtel installations, GIT should always be run from the jtel user.\nIf you really want to run git as root, you will need to access it directly, using /usr/bin/git for example.\n"'
EOFF
source ~/.bashrc |
|
Transfer SSH keys to root The following commands replicate the SSH keys from the jtel user to the root user: Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Configuration jtel User |
---|
| cp -a /home/jtel/.ssh /root
chown -R root:root /root/.ssh |
|
Set NTP to PTB The following commands enter the official time servers of the Physikalisch-Technische Bundesanstalt into the configuration file of the time synchronization service, configure the service to start automatically, synchronize the time once with one of the PTB servers and start the service Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Time Synchronisation |
---|
| sed -i -e "s/^server 0.centos.pool.ntp.org iburst$/server ptbtime1.ptb.de iburst\nserver ptbtime2.ptb.de iburst\nserver ptbtime3.ptb.de iburst\nserver 0.centos.pool.ntp.org iburst/" /etc/ntp.conf
chkconfig ntpd on
ntpdate ptbtime2.ptb.de
service ntpd start
|
|
Check NTP See here: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/s1-Checking_the_Status_of_NTP.html for an explanation Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Check Time Synchronisation |
---|
| ntpq -p |
|
Uninstalling anacron, installing cron Since the anacron service stops if one of the maintenance scripts does not run, it is uninstalled and the cron service is installed: Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Uninstall anacron, Install cron |
---|
| sudo yum -y install cronie-noanacron
sudo yum -y remove cronie-anacron |
|
VMWare / Hyper-V / Virtualization Tools (NOT AZURE) Install VMWare Tools
Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Install VMWare Tools´ |
---|
| yum -y install open-vm-tools |
|
Hyper-V
Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Install Hyper-V Tools |
---|
| yum -y install hyperv-daemons |
|
Other virtualization environmentsContact the respective manufacturer. Proxy Server EntryIf a proxy server is used then use the following commands to set this up for root and the jtel user - please adjust the upper lines: Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Configure Proxy Server |
---|
|
PROXY_USERNAME=
PROXY_PASSWORD=
PROXY_SERVER=proxy.example.de
PROXY_PORT=3128
PROXY_EXCEPTIONS=.example.de,.local,10.200.21.
if [ -n "$PROXY_USERNAME" ] && [ -n "$PROXY_PASSWORD" ]
then
PROXY="http://$USERNAME:$PASSWORD@$PROXY_SERVER:$PROXY_PORT"
elif [ -n "$PROXY_USERNAME" ]
then
PROXY="http://$USERNAME@$PROXY_SERVER:$PROXY_PORT"
else
PROXY="http://$PROXY_SERVER:$PROXY_PORT"
fi
cat <<EOFF >> ~/.bashrc
export ALL_PROXY=$PROXY
export HTTP_PROXY=$PROXY
export HTTPS_PROXY=$PROXY
export FTP_PROXY=$PROXY
export RSYNC_PROXY=$PROXY
export http_proxy=$PROXY
export https_proxy=$PROXY
export ftp_proxy=$PROXY
export rsync_proxy=$PROXY
export NO_PROXY=$PROXY_EXCEPTIONS
EOFF
cat <<EOFF >> /home/jtel/.bashrc
export ALL_PROXY=$PROXY
export HTTP_PROXY=$PROXY
export HTTPS_PROXY=$PROXY
export FTP_PROXY=$PROXY
export RSYNC_PROXY=$PROXY
export http_proxy=$PROXY
export https_proxy=$PROXY
export ftp_proxy=$PROXY
export rsync_proxy=$PROXY
export NO_PROXY=$PROXY_EXCEPTIONS
EOFF
source ~/.bashrc
|
|
Ensuring name resolution Edit the /etc/hosts file, and enter the names of the different machines for the solution: Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | /etc/hosts |
---|
| 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.10 acd-lb acd-lb.example.com
192.168.1.10 acd-store acd-store.example.com
192.168.1.21 acd-dbm acd-dbm.example.com
192.168.1.22 acd-dbs acd-dbs.example.com
192.168.1.22 acd-dbr acd-dbr.example.com
192.168.1.31 acd-jb1 acd-jb1.example.com
192.168.1.32 acd-jb2 acd-jb2.example.com
192.168.1.40 acd-tel1 acd-tel1.example.com |
|
|
Sv translation |
---|
|
Folgende Schritte werden direkt nach der Grundinstallation durchgeführt, bevor eine bestimmte Rolle des Servers konfiguriert wird. Azure CloudBei der Azure Cloud gibt man bei der Grundinstallation ein User an. Das root Passwort bleibt verborgen. Auf root kann man jedoch mit folgenden Befehl wechseln, die Eingabe des eigenen Passwortes ist erforderlich: Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | sudo in Azure Cloud |
---|
| sudo -s |
|
Desweiteren ist es erforderlich, die Netzwerkkarte(n) eine Zone zuzuordnen. Dies geschieht über das Editieren der Netzwerk-Konfiguration: Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Netzwerkeinstellungen Azure Cloud |
---|
| vi /etc/sysconfig/network-scripts/ifcfg-eth0
... (add at end)
ZONE=public
...
service network restart |
|
System UpdateSystem aktualisieren und erste Pakete installieren
Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Update and Installation |
---|
| yum -y update
yum -y install nano unzip ntp ntpdate wget man openssh-clients rsync screen sysstat nfs-utils cifs-utils policycoreutils-python yum-plugin-versionlock yum-utils nmap bind-utils tcpdump lsof tmux tmpwatch
yum -y install https://repo.ius.io/ius-release-el7.rpm
yum -y install epel-release
# LAG: NO LONGER NEEDED
# Removed 17.09.2018 after feedback from FK
# yum -y install http://mirror1.hs-esslingen.de/repoforge/redhat/el7/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
# yum-config-manager --enable rpmforge-extras |
|
Reboot ipv6 Disabeln
Warning |
---|
| Falls das yum update scheitert, wegen IPv6, kann ipv6 disabled werden. |
Translations Ignore |
---|
Code Block |
---|
| vi /etc/sysctl.d/disable-ipv6.conf
# Add the following lines
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
# Then issue the following command
sysctl -p
# Then edit yum.conf
vi /etc/yum.conf
# Add the following line
ip_resolve=4
# Then reboot
reboot |
|
GrundkonfigurationSicherstellen, dass firewalld läuft (Benötigt für Azure Cloud Installation) Die nachfolgende Befehle stellen sicher, dass firewalld läuft. Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | firewalld configuration |
---|
| systemctl disable iptables
systemctl mask iptables
systemctl enable firewalld
systemctl start firewalld
|
|
User jtel erzeugen Die nachfolgende Befehle erzeugen den Benutzer jtel , fügen ihn der Gruppe wheel zu und geben ihm das Passwort <password> : Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | jtel User |
---|
| useradd -m jtel
gpasswd -a jtel wheel
printf '<password>\n<password>\n' | passwd jtel |
|
SSH Schlüssel eintragen Als nächstes werden die SSH-Schlüssel der jtel-Projekt-Techniker eingetragen, so dass ein gesichertes Login ohne separate Passworteingabe möglich wird. Standardmäßig existiert im Home-Verzeichnis von root weder das SSH-Konfigurationsverzeichnis noch die entsprechende Konfigurationsdatei. Dies alles wird mit den Befehlen im Nachfolgenden Code-Block erzeugt: Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | SSH Keys |
---|
| mkdir -p /home/jtel/.ssh
cat << EOFF > /home/jtel/.ssh/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAgJWox9vkWssx24V6m+VB/9cfFUznUnVJqHeSnQFcE+ANzH+lgv90jQYXRf8XLSaKA4HZGO7SFUwLz7eNHk0lIS+TG+WKGrjl3GRvzNoYVAapeKUV7HjbeagQPNOCKTr6G8Vi/GVMyOx8XhJAgpr5gjyW9GdMdqnOS9uxd83BCh/UiAP9oVUbLiIIxbtmLAzyfJdjnbFP9sJXw96Vl040Fe4aoLofrkPyPu7cst6TPJx5myDhORG31nD/2iwUNLfv58m9ABMsePfhqzSp/Hi2XY/e5gikDh3xUxoBmL9fWwbiFb92AFW08rP1CtoCEtOe2nJkdtRzt0GiE+A+zgdDjw== support@jtel.de
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAuP5DEZDI6/CITTqk8qburqDuKNj6jnQ9Zbjz6BO+5P8MlrS8KT7y56u/PSqdO3OzD58D2JS0yNvM5RbBGYDUD1ng7VSJLFLfErbuCzJ/Q+BSRaee+7MhLWXdVSc/EY2B4qUcZGRL/NXHtAY/3KvSSU3wnhI4edLYMAzuxAhNEPRkmniq1CAuykDdHvm0kVQzaSShYDBQWIlbWIMG6jsCmMpZR7v+v6gKWeowQkM4T4XZ1f2K5zlQXd6FHGY8C/+XICefum2qgQtqgjfQMoqIQbnmfKDGIHPvkas287tdCbU4y1lTsJbTiT7INkd6QbiVUayVxVwwoV+G2F7WofN4nw== root@jtel.de
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEArTi8N08gDz1CvD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exO2fSzNa7e+dYsfImOQoYlxFBX5YU74Ay9F5b7K95Cxe8EstvKNVmjkNWgnNWuS2d7eabepC1jv3z0FdOGiVoZ1SDgqKz8ysBa6Rzkt5L5peHYAKyH8TedeUk7kRIwZQ== dhia@jtel.de
EOFF
restorecon -R -v /home/jtel/.ssh
chown -R jtel:jtel /home/jtel/.ssh
chmod 0700 /home/jtel/.ssh
chmod 0644 /home/jtel/.ssh/authorized_keys |
|
Hinweis: alle anderen SSH keys nicht mehr verwenden. Damit diese auch korrekt funktionieren, müssen die SELINUX-Security-Labels korrekt angepasst werden. Dies erledigt der Befehl am Ende des Code-Blocks. History Funktion verbessern Der Nachfolgende Befehl generiert eine Konfigurationsdatei zur Verbesserung der History-Funktion der Shell: Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | History Function |
---|
| cat <<EOFF > ~/.inputrc
"\e[A": history-search-backward
"\e[B": history-search-forward
set show-all-if-ambiguous on
set completion-ignore-case on
EOFF |
|
Screen Multiplexer verbessern Der Nachfolgende Befehl verbessert die Darstellung des screen-Multiplexers. Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Screen Multiplexer |
---|
| cat <<EOFF >> /etc/screenrc
# JTEL:Added
startup_message off
vbell off
hardstatus alwayslastline "%{kw} %{b}%H%{K} < %-w%{Wb} %n %t %{-}%+w >"
# This lets work all functions keys in midnight commander
# termcapinfo xterm 'k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~'
EOFF
|
|
Wheel (sudo) Konfiguration Der Nachfolgende Befehl erzeugt eine Konfigurationskomponente, um den Benutzern der Gruppe wheel das Recht zu geben, Befehle als root mittels des Tools sudo auszuführen: Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Sudo Authorisation |
---|
| cat <<EOFF > /etc/sudoers.d/wheelers
## Allows people in group wheel to run all commands
%wheel ALL=(ALL) ALL
EOFF
|
|
Shell Konfiguration auf jtel übertragen Die nachfolgende Befehle replizieren die Shell-Konfiguration vom Benutzer root in den Benutzer jtel : Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Configuration jtel User |
---|
| cp -a /root/.inputrc /home/jtel
chown -R jtel:jtel /home/jtel/.inputrc
|
|
Root hinweis für GIT Die nachfolgende Befehle machen das Ausführen von GIT als root schwieriger, da dies immer im Kontext vom jtel user geschehen soll: Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | root Warning for GIT |
---|
| cat <<EOFF >> ~/.bashrc
alias git='printf "It looks like you are trying to run GIT as ROOT.\nFor jtel installations, GIT should always be run from the jtel user.\nIf you really want to run git as root, you will need to access it directly, using /usr/bin/git for example.\n"'
EOFF
source ~/.bashrc |
|
SSH Keys auf root übertragen Die nachfolgende Befehle replizieren die SSH Keys vom Benutzer jtel in den Benutzer root : Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Configuration jtel User |
---|
| cp -a /home/jtel/.ssh /root
chown -R root:root /root/.ssh |
|
NTP auf PTB einstellen Die nachfolgende Befehle tragen die offiziellen Zeitserver der Physikalisch-Technischen-Bundesanstalt in die Konfigurationsdatei des Zeitsynchonisationsdienstes ein, konfigurieren den Dienst so, dass er automatisch startet, synchronisieren die Zeit einmalig mit einem der PTB-Server und starten den Dienst. Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Time Synchronisation |
---|
| sed -i -e "s/^server 0.centos.pool.ntp.org iburst$/server ptbtime1.ptb.de iburst\nserver ptbtime2.ptb.de iburst\nserver ptbtime3.ptb.de iburst\nserver 0.centos.pool.ntp.org iburst/" /etc/ntp.conf
chkconfig ntpd on
ntpdate ptbtime2.ptb.de
service ntpd start
|
|
NTP Prüfen Siehe hier: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/s1-Checking_the_Status_of_NTP.html für eine Erklärung. Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Check Time Synchronisation |
---|
| ntpq -p |
|
Deinstallation anacron, Installation cron Da der anacron Dienst stehen bleibt, wenn einer der Wartungsskripte nicht durchläuft, wird dieser deinstalliert, und der cron dienst installiert: Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Uninstall anacron, Install cron |
---|
| sudo yum -y install cronie-noanacron
sudo yum -y remove cronie-anacron |
|
VMWare / Hyper-V / Virtualisierungs-Tools (NICHT BEI AZURE) VMWare Tools installieren
Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Install VMWare Tools´ |
---|
| yum -y install open-vm-tools |
|
Hyper-V
Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Install Hyper-V Tools |
---|
| yum -y install hyperv-daemons |
|
Andere VirtualisierungsumgebungenDen jeweiligen Hersteller kontaktieren. Proxy Server EintragFalls ein Proxyserver verwendet wird, dann folgende Befehle nutzen um dies für root und den jtel user einzurichten - die oberen Zeilen bitte anpassen: Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Configure Proxy Server |
---|
|
PROXY_USERNAME=
PROXY_PASSWORD=
PROXY_SERVER=proxy.example.de
PROXY_PORT=3128
PROXY_EXCEPTIONS=.example.de,.local,10.200.21.
if [ -n "$PROXY_USERNAME" ] && [ -n "$PROXY_PASSWORD" ]
then
PROXY="http://$USERNAME:$PASSWORD@$PROXY_SERVER:$PROXY_PORT"
elif [ -n "$PROXY_USERNAME" ]
then
PROXY="http://$USERNAME@$PROXY_SERVER:$PROXY_PORT"
else
PROXY="http://$PROXY_SERVER:$PROXY_PORT"
fi
cat <<EOFF >> ~/.bashrc
export ALL_PROXY=$PROXY
export HTTP_PROXY=$PROXY
export HTTPS_PROXY=$PROXY
export FTP_PROXY=$PROXY
export RSYNC_PROXY=$PROXY
export http_proxy=$PROXY
export https_proxy=$PROXY
export ftp_proxy=$PROXY
export rsync_proxy=$PROXY
export NO_PROXY=$PROXY_EXCEPTIONS
EOFF
cat <<EOFF >> /home/jtel/.bashrc
export ALL_PROXY=$PROXY
export HTTP_PROXY=$PROXY
export HTTPS_PROXY=$PROXY
export FTP_PROXY=$PROXY
export RSYNC_PROXY=$PROXY
export http_proxy=$PROXY
export https_proxy=$PROXY
export ftp_proxy=$PROXY
export rsync_proxy=$PROXY
export NO_PROXY=$PROXY_EXCEPTIONS
EOFF
source ~/.bashrc
|
|
Sicherstellen der Namensauflösung Die Datei /etc/hosts editieren, und die entsprechenden Namen der verschiednen Rechner für die Lösung eintragen: Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | /etc/hosts |
---|
| 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.10 acd-lb acd-lb.example.com
192.168.1.10 acd-store acd-store.example.com
192.168.1.21 acd-dbm acd-dbm.example.com
192.168.1.22 acd-dbs acd-dbs.example.com
192.168.1.22 acd-dbr acd-dbr.example.com
192.168.1.31 acd-jb1 acd-jb1.example.com
192.168.1.32 acd-jb2 acd-jb2.example.com
192.168.1.40 acd-tel1 acd-tel1.example.com |
|
|
Sv translation |
---|
|
Cloud AzurePour le nuage d'azur, vous spécifiez un utilisateur lors de l'installation de base. Le mot de passe root reste caché. Cependant, vous pouvez passer en root avec la commande suivante, la saisie de votre propre mot de passe est nécessaire : Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | sudo dans Azure Cloud |
---|
| sudo -s |
|
En outre, il est nécessaire d'affecter la ou les cartes réseau à une zone. Cela se fait en modifiant la configuration du réseau : Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Paramètres du réseau Cloud Azure |
---|
| vi /etc/sysconfig/network-scripts/ifcfg-eth0 ... (add at end) ZONE=public ... service network restart |
|
Mise à jour systèmeMise à jour du système et installation des premiers paquets
Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Mise à jour et installation |
---|
| yum -y update yum -y install nano unzip ntp ntpdate wget man openssh-clients rsync screen sysstat nfs-utils cifs-utils policycoreutils-python yum-plugin-versionlock yum-utils nmap bind-utils tcpdump lsof tmux tmpwatch yum -y install https://repo.ius.io/ius-release-el7. rpm yum -y install epel-release # LAG : NO LONGER NE BESOIN # Supprimé le 17.09.2018 après les réactions de FK # yum -y install http://mirror1.hs-esslingen.de/repoforge/redhat/el7/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm # yum-config-manager --enable rpmforge-extras |
|
Reboot désactiver l'IPv6
Warning |
---|
| Si la mise à jour de yum échoue à cause de l'IPv6, l'ipv6 peut être désactivé. |
Translations Ignore |
---|
Code Block |
---|
| vi /etc/sysctl.d/disable-ipv6.conf # Ajouter les lignes suivantes net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 # Puis lancer la commande suivante sysctl -p # Puis éditer yum.conf vi /etc/yum.conf # Ajouter la ligne suivante ip_resolve=4 # Puis redémarrer |
|
Configuration de baseAssurez-vous que le firewalld fonctionne (Requis pour l'installation de Azure Cloud) Les commandes suivantes permettent de s'assurer que le firewalld fonctionne. Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | configuration du firewalld |
---|
| systemctl disable iptables systemctl mask iptables systemctl enable firewalld systemctl start firewalld |
|
Créer un utilisateur jtel Les commandes suivantes permettent de créer l'utilisateur jtel , l'ajouter au groupe wheel et lui donner le mot de passe <password> : Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | utilisateur jtel |
---|
| useradd -m jtel gpasswd -a jtel wheel printf '<password>\n<password>\n' | passwd jtel |
|
Entrez la clé SSH Ensuite, les clés SSH des techniciens du projet jtel sont saisies de manière à ce qu'une connexion sécurisée soit possible sans saisie séparée du mot de passe. Par défaut, ni le répertoire de configuration SSH ni le fichier de configuration correspondant n'existent dans répertoire d'accueil root . Tout cela est généré avec les commandes du bloc de code suivant : Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Clés SSH |
---|
| mkdir -p /home/jtel/.ssh cat << EOFF > /home/jtel/.ssh/authorized_keys ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAgJWox9vkWssx24V6m+VB/9cfFUznUnVJqHeSnQFcE+ANz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OHrg243tqAUmuqICWompZNO75v3HjIIXOebxVGBXugrYc2xR1q964/EE0ZR7JMWM+HJ47V8WJKkE126n9ZElCqNGIR+Q== heidi.mueller@jtel.de ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAilON3Cn1bZPBYtv67Bv63llD1KMTTH52/ioPLm+qYYDV80mSHSb+PHD9awXNKNv5iTecaQ/a56CkK0z+KI5zvJb3EiRZaRe70cIqdflHmTcasVPVk1hAma5xc5UOCr+dKokqMQGwpDRrDvdS3atflQznvlR8+qoxPjlKC4KDx0GOUeSOIPBO6DdYGPlFX6ohMVRE7p/vHIRAOfehmG1xFtfk+rGPmgiblPWWWklKYQUfMnHI0pqFJwrPW46nqdUlQwtknATZC2cuKe931zstFhuDsm218yS4hTTlcjw5i/DH7PFr9Y58BtY6ZTy8khwTUeMPpSxE7i2WYoqoJ7DXcw== sou@jtel.de ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEA0czZLbpaxo/EY9iHDq9n6EWTALeYB7GVmp/mLwp66zeV4DbvTm+3FDUJSD9rqMJzJkAAEicFe+II/ZdIeZzG4JdYf66M/Y6k0w0Y8jJqDtsdgUf3OJ1hJ53Z+BwFqy1vD/a7N2hxlEKD2rzyAfVb+xzTzhJTjpX1kNiUxDMXRZs4ytW0CbOqZSpTJ3eT9NS9gH188KFTvHN8rPzDAxRKcexO2fSzNa7e+dYsfImOQoYlxFBX5YU74Ay9F5b7K95Cxe8EstvKNVmjkNWgnNWuS2d7eabepC1jv3z0FdOGiVoZ1SDgqKz8ysBa6Rzkt5L5peHYAKyH8TedeUk7kRIwZQ== dhia@jtel.de EOFF restorecon -R -v /home/jtel/.ssh chown -R jtel:jtel /home/jtel/.ssh chmod 0700 /home/jtel/.ssh chmod 0644 /home/jtel/.ssh/authorized_keys |
|
Note : n'utilisez pas toutes les autres clés SSH. Pour qu'elles fonctionnent correctement, les étiquettes de sécurité SELINUX doivent être adaptées correctement. Cela se fait par la commande à la fin du bloc de code. Improve la fonction historique La commande suivante génère un fichier de configuration pour améliorer la fonction d'historique du shell : Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Fonction Historique |
---|
| cat <<EOFF > ~/.inputrc "\e[A": history-search-backward "\e[B": history-search-forward set show-all-if-ambiguous on set completion-ignore-case on EOFF |
|
Améliorer le multiplexeur d'écran La commande suivante permet d'améliorer l'affichage du multiplexeur d'écran. Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Multiplexeur d'écran |
---|
| cat <<EOFF >> /etc/screenrc # JTEL:Added startup_message off vbell off hardstatus alwayslastline "%{kw} %{b}%H%{K} < %-w%{Wb} %n %t %{-}%+w >" # This lets work all functions keys in midnight commander # termcapinfo xterm 'k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~' EOFF |
|
Configuration Wheel (sudo) La commande suivante crée un composant de configuration pour donner aux utilisateurs du wheel le droit d'exécuter des commandes en tant que root en utilisant l'outil sudo : Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Autorisation Sudo |
---|
| cat <<EOFF > /etc/sudoers.d/wheelers ## Allows people in group wheel to run all commands %wheel ALL=(ALL) ALL EOFF |
|
Transférer la configuration du shell vers jtel Les commandes suivantes reproduisent la configuration du shell à partir de l'utilisateur root à l'utilisateur jtel : Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Configuration Utilisateur jtel |
---|
| cp -a /root/.inputrc /home/jtel chown -R jtel:jtel /home/jtel/.inputrc |
|
Indice Root pout GIT Les commandes suivantes rendent plus difficile l'exécution de GIT en tant que root, puisque cela doit toujours être fait dans le contexte de l'utilisateur jtel : Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | avertissement Root pour GIT |
---|
| cat <<EOFF >> ~/.bashrc alias git='printf "Il semble que vous essayez d'exécuter GIT en tant que ROOT.\nPour les installations jtel, GIT devrait toujours être exécuté par l'utilisateur jtel.\nSi vous voulez vraiment exécuter git en tant que root, vous devrez y accéder directement, en utilisant /usr/bin/git par exemple.\n"' EOFF source ~/.bashrc |
|
Transférer les clés SSH au root Les commandes suivantes reproduisent les clés SSH de l'utilisateur jtel à l'utilisateur root : Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Configuration Utilisateur jtel |
---|
| cp -a /home/jtel/.ssh /root chown -R root:root /root/.ssh |
|
Mettre NTP à PTB Les commandes suivantes permettent d'entrer les serveurs de temps officiels de la Physikalisch-Technische Bundesanstalt dans le fichier de configuration du service de synchronisation du temps, de configurer le service pour qu'il démarre automatiquement, de synchroniser le temps une fois avec l'un des serveurs PTB et de démarrer le service Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Synchronisation du temps |
---|
| sed -i -e "s/^server 0.centos.pool.ntp.org iburst$/server ptbtime1.ptb.de iburst\nserver ptbtime2.ptb.de iburst\nserver ptbtime3.ptb.de iburst\nserver 0.centos.pool.ntp.org iburst/" /etc/ntp.conf chkconfig ntpd on ntpdate ptbtime2.ptb.de service ntpd start |
|
Vérifier le NTP Voir ici: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/s1-Checking_the_Status_of_NTP.html pour une explication Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Vérifier la synchronisation du temps |
---|
| ntpq -p |
|
Désinstallation de l'anacron, installation du cron Comme le service anacron s'arrête si l'un des scripts de maintenance ne fonctionne pas, il est désinstallé et le service cron est installé : Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Désinstaller anacron, Installer cron |
---|
| sudo yum -y install cronie-noanacron sudo yum -y remove cronie-anacron |
|
VMWare / Hyper-V / Virtualization Tools (NOT AZURE) Installer les outils VMWare
Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Installer les outils VMWare |
---|
| yum -y install open-vm-tools |
|
Hyper-V
Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Installer les outils Hyper-V |
---|
| yum -y install hyperv-daemons |
|
Autres environnements de virtualisationContactez le fabricant concerné. Entrée du serveur proxySi un serveur proxy est utilisé, utilisez les commandes suivantes pour le configurer root et l'utilisateur jtel - veuillez ajuster les lignes supérieures : Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Configurer le serveur proxy |
---|
| PROXY_USERNAME= PROXY_PASSWORD= PROXY_SERVER=proxy.example.de PROXY_PORT=3128 PROXY_EXCEPTIONS=.example.de,.local,10.200.21. if [ -n "$PROXY_USERNAME" ] && [ -n "$PROXY_PASSWORD" ] then PROXY="http://$USERNAME:$PASSWORD@$PROXY_SERVER:$PROXY_PORT" elif [ -n "$PROXY_USERNAME" ] then PROXY="http://$USERNAME@$PROXY_SERVER:$PROXY_PORT" else PROXY="http://$PROXY_SERVER:$PROXY_PORT" fi cat <<EOFF >> ~/.bashrc export ALL_PROXY=$PROXY export HTTP_PROXY=$PROXY export HTTPS_PROXY=$PROXY export FTP_PROXY=$PROXY export RSYNC_PROXY=$PROXY export http_proxy=$PROXY export https_proxy=$PROXY export ftp_proxy=$PROXY export rsync_proxy=$PROXY export NO_PROXY=$PROXY_EXCEPTIONS EOFF cat <<EOFF >> /home/jtel/.bashrc export ALL_PROXY=$PROXY export HTTP_PROXY=$PROXY export HTTPS_PROXY=$PROXY export FTP_PROXY=$PROXY export RSYNC_PROXY=$PROXY export http_proxy=$PROXY export https_proxy=$PROXY export ftp_proxy=$PROXY export rsync_proxy=$PROXY export NO_PROXY=$PROXY_EXCEPTIONS EOFF source ~/.bashrc |
|
Garantir la résolution des noms Modifiez le fichier /etc/hosts, et entrez les noms des différentes machines pour la solution : Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | /etc/hosts |
---|
| 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.1.10 acd-lb acd-lb.example.com 192.168.1.10 acd-store acd-store.example.com 192.168.1.21 acd-dbm acd-dbm.example.com 192.168.1.22 acd-dbs acd-dbs.example.com 192.168.1.22 acd-dbr acd-dbr.example.com 192.168.1.31 acd-jb1 acd-jb1.example.com 192.168.1.32 acd-jb2 acd-jb2.example.com 192.168.1.40 acd-tel1 acd-tel1.example.com |
|
|
...