initial_config_deb
Differences
This shows you the differences between two versions of the page.
| initial_config_deb [2025/07/26 17:09] – - Imported by DokuWiki Advanced Plugin wikiadm | initial_config_deb [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Configuração inicial ====== | ||
| - | ===== Pacotes essenciais ===== | ||
| - | <code bash> | ||
| - | $ su - | ||
| - | # apt update | ||
| - | # apt install vim wget curl git sudo accountsservice software-properties-common \ | ||
| - | bash-completion apt-transport-https \ | ||
| - | ca-certificates gnupg2 lsb-release | ||
| - | </ | ||
| - | Outros | ||
| - | |||
| - | <file bash> | ||
| - | # apt install lvm2 build-essential jq | ||
| - | </ | ||
| - | |||
| - | Se a instalação for em um ESXI acrescentar | ||
| - | <file bash> | ||
| - | # apt install open-vm-tools | ||
| - | </ | ||
| - | |||
| - | Bash usuário root | ||
| - | <file bash .bashrc> | ||
| - | # cat .bashrc | ||
| - | # ~/.bashrc: executed by bash(1) for non-login shells. | ||
| - | |||
| - | # Note: PS1 and umask are already set in / | ||
| - | # need this unless you want different defaults for root. | ||
| - | # PS1=' | ||
| - | # umask 022 | ||
| - | PS1=' | ||
| - | |||
| - | # You may uncomment the following lines if you want `ls' to be colorized: | ||
| - | export LS_OPTIONS=' | ||
| - | eval " | ||
| - | alias ls='ls $LS_OPTIONS' | ||
| - | # alias ll='ls $LS_OPTIONS -l' | ||
| - | # alias l='ls $LS_OPTIONS -lA' | ||
| - | # | ||
| - | alias egrep=' | ||
| - | alias fgrep=' | ||
| - | alias grep=' | ||
| - | |||
| - | # Some more alias to avoid making mistakes: | ||
| - | alias rm='rm -i' | ||
| - | alias cp='cp -i' | ||
| - | alias mv='mv -i' | ||
| - | alias vi=' | ||
| - | alias editor=' | ||
| - | alias ping=' | ||
| - | export HISTTIMEFORMAT=' | ||
| - | #export HISTTIMEFORMAT=' | ||
| - | #export PROMPT_COMMAND=" | ||
| - | </ | ||
| - | ===== Configuração de Usuário ===== | ||
| - | |||
| - | <code bash> | ||
| - | # usermod -aG sudo suporte | ||
| - | </ | ||
| - | |||
| - | Ou | ||
| - | <file bash> | ||
| - | # visudo -f / | ||
| - | suporte ALL=(ALL) NOPASSWD: | ||
| - | </ | ||
| - | |||
| - | ===== VIM ===== | ||
| - | [[vimrc|vimrc]] | ||
| - | |||
| - | ===== Rede ===== | ||
| - | <code bash> | ||
| - | $ cat / | ||
| - | # This file describes the network interfaces available on your system | ||
| - | # and how to activate them. For more information, | ||
| - | |||
| - | source / | ||
| - | |||
| - | # The loopback network interface | ||
| - | auto lo | ||
| - | iface lo inet loopback | ||
| - | |||
| - | # The primary network interface | ||
| - | allow-hotplug ens192 | ||
| - | iface ens192 inet static | ||
| - | address 177.75.176.40/ | ||
| - | gateway 177.75.176.33 | ||
| - | |||
| - | iface ens192 inet6 static | ||
| - | address 2804: | ||
| - | gateway 2804: | ||
| - | # dns-* options are implemented by the resolvconf package, if installed | ||
| - | dns-nameservers 177.75.176.25 2804: | ||
| - | dns-search juntotelecom.com.br | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ sudo hostnamectl set-hostname vm-01.juntotelecom.com.br | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ echo -e " | ||
| - | </ | ||
| - | ===== NTP ===== | ||
| - | <code bash> | ||
| - | $ sudo timedatectl set-time ' | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ sudo timedatectl set-timezone America/ | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ timedatectl status | ||
| - | Local time: ter 2022-04-05 15:31:30 -03 | ||
| - | | ||
| - | RTC time: ter 2022-04-05 18:31:30 | ||
| - | Time zone: America/ | ||
| - | System clock synchronized: | ||
| - | NTP service: active | ||
| - | RTC in local TZ: no | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ sudo apt update | ||
| - | $ sudo apt install chrony | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ sudo vim / | ||
| - | [...] | ||
| - | #pool 2.debian.pool.ntp.org iburst | ||
| - | pool pool.ntp.br iburst | ||
| - | [...] | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ sudo timedatectl set-ntp true | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ sudo systemctl restart chronyd | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ chronyc sources -v | ||
| - | |||
| - | .-- Source mode ' | ||
| - | / .- Source state ' | ||
| - | | / ' | ||
| - | || .- xxxx [ yyyy ] +/- zzzz | ||
| - | || Reachability register (octal) -. | ||
| - | || Log2(Polling interval) --. | | yyyy = measured offset, | ||
| - | || \ | ||
| - | || | ||
| - | MS Name/IP address | ||
| - | =============================================================================== | ||
| - | ^- b.ntp.br | ||
| - | ^? a.st1.ntp.br | ||
| - | ^? gps.jd.ntp.br | ||
| - | ^? c.ntp.br | ||
| - | ^? a.ntp.br | ||
| - | ^* a.ntp.br | ||
| - | ^? b.ntp.br | ||
| - | ^- c.ntp.br | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ chronyc tracking | ||
| - | Reference ID : C8A00008 (a.ntp.br) | ||
| - | Stratum | ||
| - | Ref time (UTC) : Tue Apr 05 18:35:49 2022 | ||
| - | System time : 0.000000057 seconds fast of NTP time | ||
| - | Last offset | ||
| - | RMS offset | ||
| - | Frequency | ||
| - | Residual freq : -24.961 ppm | ||
| - | Skew : 0.250 ppm | ||
| - | Root delay : 0.002586446 seconds | ||
| - | Root dispersion : 0.003777417 seconds | ||
| - | Update interval : 0.8 seconds | ||
| - | Leap status | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ chronyc sourcestats | ||
| - | Name/IP Address | ||
| - | ============================================================================== | ||
| - | b.ntp.br | ||
| - | a.st1.ntp.br | ||
| - | gps.jd.ntp.br | ||
| - | c.ntp.br | ||
| - | a.ntp.br | ||
| - | a.ntp.br | ||
| - | b.ntp.br | ||
| - | c.ntp.br | ||
| - | </ | ||
| - | |||
| - | ===== Alterando a porta do SSH ===== | ||
| - | <file bash> | ||
| - | $ sudo sed -i '/# | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo cat / | ||
| - | #Port 22 | ||
| - | Port 22022 | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo systemctl restart sshd.service | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ ss -nltp | grep 22022 | ||
| - | LISTEN 0 128 0.0.0.0: | ||
| - | LISTEN 0 128 | ||
| - | </ | ||
initial_config_deb.1753560543.txt.gz · Last modified: by wikiadm
