User Tools

Site Tools


initial_config_deb

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

initial_config_deb [2025/07/26 17:09] – - Imported by DokuWiki Advanced Plugin wikiadminitial_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 
-</code> 
  
-Outros 
- 
-<file bash> 
-# apt install lvm2  build-essential jq 
-</file> 
- 
-Se a instalação for em um ESXI acrescentar  
-<file bash> 
-# apt install open-vm-tools 
-</file> 
- 
-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 /etc/profile. You should not 
-# need this unless you want different defaults for root. 
-# PS1='${debian_chroot:+($debian_chroot)}\h:\w\$ ' 
-# umask 022 
-PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u\[\033[01;34m\]@\[\033[01;33m\]\h\[\033[01;34m\][\[\033[00m\]\[\033[01;37m\]\w\[\033[01;34m\]]\[\033[01;31m\]\$\[\033[00m\] ' 
- 
-# You may uncomment the following lines if you want `ls' to be colorized: 
-export LS_OPTIONS='--color=auto' 
-eval "$(dircolors)" 
-alias ls='ls $LS_OPTIONS' 
-# alias ll='ls $LS_OPTIONS -l' 
-# alias l='ls $LS_OPTIONS -lA' 
-# 
-alias egrep='egrep --color=auto' 
-alias fgrep='fgrep --color=auto' 
-alias grep='grep --color=auto' 
- 
-# Some more alias to avoid making mistakes: 
-alias rm='rm -i' 
-alias cp='cp -i' 
-alias mv='mv -i' 
-alias vi='vim' 
-alias editor='vi' 
-alias ping='ping -c3' 
-export HISTTIMEFORMAT='%d-%m-%Y %H:%M- ' 
-#export HISTTIMEFORMAT='%F %T ' 
-#export PROMPT_COMMAND="history -c" 
-</file> 
-===== Configuração de Usuário ===== 
- 
-<code bash> 
-# usermod -aG sudo suporte 
-</code> 
- 
-Ou  
-<file bash> 
-# visudo -f /etc/sudoers.d/suporte 
-suporte ALL=(ALL) NOPASSWD:ALL 
-</file> 
- 
-===== VIM ===== 
-[[vimrc|vimrc]] 
- 
-===== Rede ===== 
-<code bash> 
-$ cat /etc/network/interfaces 
-# This file describes the network interfaces available on your system 
-# and how to activate them. For more information, see interfaces(5). 
- 
-source /etc/network/interfaces.d/* 
- 
-# 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/27 
-        gateway 177.75.176.33 
- 
-iface ens192 inet6 static 
-        address 2804:694:3000:8000::40/64 
-        gateway 2804:694:3000:8000:: 
-        # dns-* options are implemented by the resolvconf package, if installed 
-        dns-nameservers 177.75.176.25 2804:694:4c00:4001::1 
-        dns-search juntotelecom.com.br 
-</code> 
- 
-<code bash> 
-$ sudo hostnamectl set-hostname vm-01.juntotelecom.com.br 
-</code> 
- 
-<file bash> 
-$ echo -e "127.0.0.1\tvm-01.juntotelecom.com.br\tvm-01" | sudo tee -a /etc/hosts 
-</file> 
-===== NTP ===== 
-<code bash> 
-$ sudo timedatectl set-time '2022-05-05 15:30:00' 
-</code> 
- 
-<code bash> 
-$ sudo timedatectl set-timezone America/Sao_Paulo 
-</code> 
- 
-<code bash> 
-$ timedatectl status 
-               Local time: ter 2022-04-05 15:31:30 -03 
-           Universal time: ter 2022-04-05 18:31:30 UTC 
-                 RTC time: ter 2022-04-05 18:31:30 
-                Time zone: America/Sao_Paulo (-03, -0300) 
-System clock synchronized: yes 
-              NTP service: active 
-          RTC in local TZ: no 
-</code> 
- 
-<code bash> 
-$ sudo apt update 
-$ sudo apt install chrony 
-</code> 
- 
-<code bash> 
-$ sudo vim /etc/chrony/chrony.conf 
-[...] 
-#pool 2.debian.pool.ntp.org iburst 
-pool pool.ntp.br iburst 
-[...] 
-</code> 
- 
-<code bash> 
-$ sudo timedatectl set-ntp true 
-</code> 
- 
-<code bash> 
-$ sudo systemctl restart chronyd 
-</code> 
- 
-<code bash> 
-$ chronyc sources -v 
- 
-  .-- Source mode  '^' = server, '=' = peer, '#' = local clock. 
- / .- Source state '*' = current best, '+' = combined, '-' = not combined, 
-| /             'x' = may be in error, '~' = too variable, '?' = unusable. 
-||                                                 .- xxxx [ yyyy ] +/- zzzz 
-||      Reachability register (octal) -.            xxxx = adjusted offset, 
-||      Log2(Polling interval) --.      |          |  yyyy = measured offset, 
-||                                \              |  zzzz = estimated error. 
-||                                    |           \ 
-MS Name/IP address         Stratum Poll Reach LastRx Last sample 
-=============================================================================== 
-^- b.ntp.br                      2      17    24   -186us[ -186us] +/-   45ms 
-^? a.st1.ntp.br                  0               +0ns[   +0ns] +/-    0ns 
-^? gps.jd.ntp.br                               +0ns[   +0ns] +/-    0ns 
-^? c.ntp.br                      0               +0ns[   +0ns] +/-    0ns 
-^? a.ntp.br                      0               +0ns[   +0ns] +/-    0ns 
-^* a.ntp.br                      2      17    26   +303us[  -54us] +/- 3343us 
-^? b.ntp.br                      0               +0ns[   +0ns] +/-    0ns 
-^- c.ntp.br                      2      17    25  +1166us[+1166us] +/-   38ms 
-</code> 
- 
-<code bash> 
-$ chronyc tracking 
-Reference ID    : C8A00008 (a.ntp.br) 
-Stratum         : 3 
-Ref time (UTC)  : Tue Apr 05 18:35:49 2022 
-System time     : 0.000000057 seconds fast of NTP time 
-Last offset     : -0.000357560 seconds 
-RMS offset      : 0.000357560 seconds 
-Frequency       : 26.038 ppm fast 
-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     : Normal 
-</code> 
- 
-<code bash> 
-$ chronyc sourcestats 
-Name/IP Address            NP  NR  Span  Frequency  Freq Skew  Offset  Std Dev 
-============================================================================== 
-b.ntp.br                    5      71    +13.665     80.742  +1093us   104us 
-a.st1.ntp.br                0           +0.000   2000.000     +0ns  4000ms 
-gps.jd.ntp.br                         +0.000   2000.000     +0ns  4000ms 
-c.ntp.br                    0           +0.000   2000.000     +0ns  4000ms 
-a.ntp.br                    0           +0.000   2000.000     +0ns  4000ms 
-a.ntp.br                    5      70     -2.523     42.783    -68us   238us 
-b.ntp.br                    0           +0.000   2000.000     +0ns  4000ms 
-c.ntp.br                    5      71     -0.930      6.718  +1140us    25us 
-</code> 
- 
-===== Alterando a porta do SSH ===== 
-<file bash> 
-$ sudo sed -i '/#Port 22/a Port 22022' /etc/ssh/sshd_config 
-</file> 
- 
-<file bash> 
-$ sudo cat /etc/ssh/sshd_config | egrep "#Port" -A1 
-#Port 22 
-Port 22022 
-</file> 
- 
-<file bash> 
-$ sudo systemctl restart sshd.service 
-</file> 
- 
-<file bash> 
-$ ss -nltp | grep 22022 
-LISTEN 0      128          0.0.0.0:22022      0.0.0.0:* 
-LISTEN 0      128             [::]:22022         [::]:* 
-</file> 
initial_config_deb.1753560543.txt.gz · Last modified: by wikiadm