AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / server / 问题

Perguntas[ubuntu](server)

Martin Hope
Kevin-Prichard
Asked: 2025-04-04 02:57:04 +0800 CST

O Mongodb falha ao iniciar após a instalação, a afirmação fatal "falha ao analisar o arquivo de fuso horário"

  • 5

No Ubuntu 22.04.1 (AMD 3970x, 64 GB de RAM (passou no memtest86), vários TB livres no sistema de arquivos raiz, sem erros SMART), instalei o Community MongoDB seguindo as instruções padrão aqui . Ao iniciar o MongoDB no systemd, ele falhou com as journalctl -xemensagens:

Apr 01 22:55:52 ganymede systemd[1]: Started MongoDB Database Server.
░░ Subject: A start job for unit mongod.service has finished successfully
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ A start job for unit mongod.service has finished successfully.
░░ 
░░ The job identifier is 9623.
Apr 01 22:55:52 ganymede sudo[427395]: pam_unix(sudo:session): session closed for user root
Apr 01 22:55:52 ganymede mongod[427399]: {"t":{"$date":"2025-04-02T05:55:52.613Z"},"s":"I",  "c":"CONTROL",  "id":7484500, "ctx":"main","msg":"Environment variable MONGODB_CONFIG_OVERRIDE_NOFORK == 1, overriding \"processManagem>
Apr 01 22:55:52 ganymede systemd[1]: mongod.service: Main process exited, code=exited, status=14/n/a
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ An ExecStart= process belonging to unit mongod.service has exited.
░░ 
░░ The process' exit code is 'exited' and its exit status is 14.
Apr 01 22:55:52 ganymede systemd[1]: mongod.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ The unit mongod.service has entered the 'failed' state with result 'exit-code'.

Mensagens de erro mais específicas da mesma tentativa de inicialização apareceram em /var/log/mongodb/mongod.log-

{"t":{"$date":"2025-04-01T22:55:52.617-07:00"},"s":"I",  "c":"CONTROL",  "id":20698,   "ctx":"main","msg":"***** SERVER RESTARTED *****"}
{"t":{"$date":"2025-04-01T22:55:52.620-07:00"},"s":"I",  "c":"CONTROL",  "id":23285,   "ctx":"main","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
{"t":{"$date":"2025-04-01T22:55:52.620-07:00"},"s":"I",  "c":"CONTROL",  "id":5945603, "ctx":"main","msg":"Multi threading initialized"}
{"t":{"$date":"2025-04-01T22:55:52.621-07:00"},"s":"I",  "c":"NETWORK",  "id":4648601, "ctx":"main","msg":"Implicit TCP FastOpen unavailable. If TCP FastOpen is required, set at least one of the related parameters","attr":{"relatedParameters":["tcpFastOpenServer","tcpFastOpenClient","tcpFastOpenQueueSize"]}}
{"t":{"$date":"2025-04-01T22:55:52.621-07:00"},"s":"I",  "c":"NETWORK",  "id":4915701, "ctx":"main","msg":"Initialized wire specification","attr":{"spec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":25},"incomingInternalClient":{"minWireVersion":0,"maxWireVersion":25},"outgoing":{"minWireVersion":6,"maxWireVersion":25},"isInternalClient":true}}}
{"t":{"$date":"2025-04-01T22:55:52.632-07:00"},"s":"F",  "c":"ASSERT",   "id":23095,   "ctx":"main","msg":"Fatal assertion","attr":{"msgid":40475,"error":"FailedToParse: failed to parse time zone file for time zone identifier \"Asia/Riyadh87\": The version used in this timezone identifier is unsupported","file":"src/mongo/db/query/datetime/date_time_support.cpp","line":219}}
{"t":{"$date":"2025-04-01T22:55:52.632-07:00"},"s":"F",  "c":"ASSERT",   "id":23096,   "ctx":"main","msg":"\n\n***aborting after fassert() failure\n\n"}

Isso parece indicar um problema com o pacote tzdata, então verifiquei de algumas maneiras:

  • dpkg --verify tzdata # sem erros ou saída
  • Verificando os aptlogs zgrep -i tzdata /var/log/apt/*.gz, houve uma atualização ontem (31 de março de 2025)
  • Ao verificar os arquivos tzdata de Riyadh, find /usr/share/zoneinfo|grep "Riyadh"|xargs -n 1 zdump -vnão havia mensagens de erro, embora alguns registros tivessem "NULL", mas não está claro se isso indica um problema.

Então, eu desinstalei essa versão ( apt remove mongodb-org-server mongodb-org-shell mongodb-org-tools mongodb-org-mongos mongodb-org-database mongodb-org-database-tools-extra mongodb-mongosh mongodb-database-tools)

Em seguida, instalei versões anteriores a partir da página de arquivo da edição comunitária , baixando arquivos .deb e iterando pelas versões 8.0.5, 8.0.4, 8.0.3, 8.0.1 e 8.0.0. Instalei cada uma delas, iniciei e verifiquei se falhavam – todas falhavam –, todas com a mesma mensagem "FailedToParse: falha ao analisar o arquivo de fuso horário para o identificador de fuso horário "Asia/Riyadh87"" em /var/log/mongodb/mongod.log.

Isso pode ser um "problema meu", mas parece improvável que um arquivo de fuso horário no tzdata com um formato não suportado consiga entrar no repositório do Ubuntu sem afetar outros serviços e sem ser corrigido imediatamente. No entanto, já tive problemas com o tzdata no Ubuntu 22.04 e consegui resolvê-los com um apt reinstall.

Prefiro executar serviços em bare metal, daí meus esforços, então, se alguém tiver alguma contribuição, agradeço. Por enquanto, vou abrir o MongoDB no Docker e cerrar os dentes.

Atualização - A instalação do mongodb-server-org adiciona um /etc/mongod.conf padrão, que contém:

processManagement:
  timeZoneInfo: /usr/local/share/tzdb

Tentei começar com e sem essas linhas, sem diferença, o mongod ainda verifica o tzdb integrado do Ubuntu e falha na asserção.

Então baixei o tzdb e o descompactei em /usr/local/share/mytzdb, apontei o mongod.conf para esse local e iniciei o mongod - sem sucesso, falhou da mesma forma.

Talvez haja uma variável de ambiente que substitua? Por enquanto, estou usando o Docker, sem problemas.

Ah, hoje de manhã uma atualização do Ubuntu teve uma atualização do tzdb, rs. Mas não corrigiu o mongod.

ubuntu
  • 1 respostas
  • 22 Views
Martin Hope
MagoLione
Asked: 2025-03-16 23:12:11 +0800 CST

O encaminhamento de porta via túnel WireGuard resulta em conexão recusada

  • 4

Tenho dois servidores conectados via WireGuard: um servidor local ( server1, WireGuard IP 10.0.0.2) e um servidor em nuvem ( server0, WireGuard IP 10.0.0.1). Meu objetivo é usar server0como um gateway para acessar serviços server1sem expor o IP público do servidor local. Por exemplo, SSH para server1deve ser acessível via server0:2222.

Detalhes da configuração:

  1. Configuração do WireGuard:

    • O túnel está funcional (verificado via ) .ssh -p 2222 [email protected]serve0r
    • server0e server1usar iptables para encaminhar tráfego.
  2. Regras do IPTables:

    • Regras do DNAT/MASQUERADE:
# For TCP 
iptables -t nat -A PREROUTING -p tcp --dport 2222 -j DNAT --to-destination 10.0.0.2:2222 
iptables -t nat -A POSTROUTING -o wg0 -p tcp -d 10.0.0.2 --dport 2222 -j MASQUERADE

# For UDP (if needed) 
iptables -t nat -A PREROUTING -p udp --dport 2222 -j DNAT --to-destination 10.0.0.2:2222 
iptables -t nat -A POSTROUTING -o wg0 -p udp -d 10.0.0.2 --dport 2222 -j MASQUERADE 
    • Tabela NAT atual:
Chain PREROUTING (policy ACCEPT)
target     prot opt source    destination         
DNAT       tcp  --  anywhere anywhere tcp dpt:2222 to:10.0.0.2:2222
DNAT       udp  --  anywhere anywhere udp dpt:2222 to:10.0.0.2:2222

Chain POSTROUTING (policy ACCEPT)
target        prot opt source      destination         
MASQUERADE    all  --  anywhere    anywhere            
MASQUERADE    all  --  anywhere    anywhere            
MASQUERADE    tcp  --  anywhere    10.0.0.2 tcp dpt:2222
MASQUERADE    udp  --  anywhere    10.0.0.2 udp dpt:2222
  1. Configuração SSH:

    • server1escuta em 0.0.0.0:2222(confirmado em sshd_config).
  2. Encaminhamento do Kernel:

    • net.ipv4.ip_forward=1está habilitado e aplicado.

Emitir:

Conectar-se externamente via ssh -p 2222 user@<server0-public-ip>resulta em Conexão recusada . No entanto, conectar-se diretamente de server0para 10.0.0.2:2222funciona.

Solução de problemas concluída:

  1. Conectividade WireGuard verificada (bem-sucedida).
  2. Regras verificadas iptables -t nat(parecem corretas).
  3. O SSH confirmado está escutando em server1.

Problemas suspeitos:

  1. Tabela de filtros IPTables : A FORWARDcadeia pode bloquear o tráfego mesmo após regras NAT.
  2. Regras do MASQUERADE : Regras redundantes ou mal configuradas POSTROUTING.

Questões:

  1. Existem iptablesregras de filtro ausentes (por exemplo, FORWARDcadeia) permitindo tráfego entre interfaces (por exemplo, eth0para wg0)?
  2. As MASQUERADEregras estão tratando corretamente o NAT de origem para o tráfego de retorno?

Qualquer informação será bem-vinda!

ubuntu
  • 1 respostas
  • 40 Views
Martin Hope
Kilian
Asked: 2025-02-27 19:37:14 +0800 CST

O armazenamento de rede falha esporadicamente ao montar o CIFS devido à ausência de conjunto de caracteres

  • 5

Às vezes, um de nossos servidores perde a conexão com nosso dispositivo de armazenamento montado e a reconexão falha.

O log do kernel afirma:

CIFS: Attempting to mount //XXXX
No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3), from CIFS (SMB1). To use the less secure SMB1 dialect to access old server which do not support SMB3 (or SMB2.1) specify vers=1.0 on mount.

CIFS VFS: CIFS mount error: iocharset utf8 not found

em /etc/fstabiocharset=utf8 é definido, então faz sentido que seja necessário.

Seguimos a resposta aqui:

https://askubuntu.com/questions/519796/unable-to-mount-cifs-with-iocharset-utf8

Após instalar o pacote ausente, podemos nos conectar ao compartilhamento novamente.

apt-install linux-modules-extra-$(uname -r).

Embora o acima corrija o problema temporariamente, depois de algumas semanas a reconexão falha novamente. Talvez esta seja a primeira vez que o servidor reinicia após outros pacotes terem sido atualizados, ainda não consegui conectar os pontos corretamente.

Como posso corrigir o problema do conjunto de caracteres a longo prazo sem precisar atualizar manualmente o pacote a cada poucas semanas?

Saída deLANG=C apt search linux-image |grep installed

linux-image-5.4.0-196-generic/focal-updates,focal-security,now 5.4.0-196.216 amd64 [installed,automatic]
linux-image-5.4.0-200-generic/focal-updates,focal-security,now 5.4.0-200.220 amd64 [installed,automatic]
linux-image-5.4.0-204-generic/focal-updates,focal-security,now 5.4.0-204.224 amd64 [installed,automatic]
linux-image-5.4.0-208-generic/focal-updates,focal-security,now 5.4.0-208.228 amd64 [installed,automatic]
linux-image-virtual/focal-updates,focal-security,now 5.4.0.208.204 amd64 [installed]
ubuntu
  • 1 respostas
  • 77 Views
Martin Hope
AAB
Asked: 2025-02-25 20:33:55 +0800 CST

Conectividade 10G e NFS

  • 11

Eu tenho um servidor rodando ubuntu, tenho uma placa 10G configurada com mtu 9000 e um servidor NFS também tem uma placa 10G e está diretamente conectado ao servidor com um link dedicado (sem switch entre eles). O servidor ubuntu tem as seguintes configurações

enp66s0f0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9000
        inet 192.168.1.2  netmask 255.255.255.252  broadcast 192.168.1.3
        inet6 fe80::d65d:64ff:fe09:b66  prefixlen 64  scopeid 0x20<link>
        ether d4:5d:64:09:0b:66  txqueuelen 1000  (Ethernet)
        RX packets 3065123981  bytes 3717515096214 (3.7 TB)
        RX errors 1963997  dropped 0  overruns 1887746  frame 76251
        TX packets 2720860289  bytes 4802586105745 (4.8 TB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 99  memory 0x20080800000-20080ffffff 

E o servidor nfs tem a seguinte configuração,

bnxt2: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 9000     options=4e527bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,
LRO,WOL_MAGIC,VLAN_HWFILTER,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6,HWSTATS,MEXTPG>
        ether 84:16:0c:aa:6b:32
        inet 192.168.1.1 netmask 0xfffffffc broadcast 192.168.1.3
        media: Ethernet autoselect (10GBase-CR1 <full-duplex>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

Não consigo ou não tenho certeza se consigo a conectividade 10G, quando copio alguns dados usando o comando dd, recebo o seguinte do bmon. Dê uma olhada e explique se estou usando o 10G de forma otimizada ou não. Esta imagem mostra o cliente nfs bmon

Esta imagem mostra o servidor nfs bmon

Esta imagem mostra o cliente nfs executando o comando dd

ubuntu
  • 1 respostas
  • 571 Views
Martin Hope
Hvprvtr
Asked: 2025-01-27 20:10:28 +0800 CST

O módulo Ansible ansible.builtin.user não funciona com caixas genéricas do Ubuntu

  • 5

Tente fazer o up generic/ubuntu18(20|22) image e adicione usuários lá pelo módulo ansible.builtin.user. Vai bem, mas o usuário não está adicionando realmente. Por que vai?

Ansible: 2.16.3

Vagabundo: 2.4.3

Sistema operacional host: Ubuntu 24.04

  config.vm.define "ubuntu18" do |ubuntu18|
    ubuntu18.vm.box = "generic/ubuntu1804"

    ubuntu18.vm.boot_timeout = 600
    ubuntu18.vm.hostname = "ubuntu18"

    ubuntu18.vm.network :private_network, ip: "192.168.56.15"

    PLAYBOOKS = [
         "ansible/nix-local-users.yml",
    ]
    PLAYBOOKS.each do |playbook|
        ubuntu18.vm.provision "ansible" do |ansible|
          ansible.playbook = playbook
          ansible.verbose = "vvv"
          ansible.extra_vars = {
              target_host: "ubuntu18"
          }
        end
    end
  end

E o manual:

---
- hosts: "{{ target_host }}"
  connection: local
  become: yes
  become_user: root
  become_method: sudo
  tasks:
    - name: Create a local nix users
      ansible.builtin.user:
        name: "{{ item.login }}"
        password: "*"
        state: present
#        password: "{{ item.password | password_hash('sha512') }}"
        create_home: yes
      with_items:
        - { login: 'LocalUser1', password: '1Passw0rd@' }
        - { login: 'LocalUser2', password: '2Passw0rd@' }
        - { login: 'LocalUser3', password: '3Passw0rd@' }

Esta saída foi obtida quando executei "vagrant up ubuntu18".

Bringing machine 'ubuntu18' up with 'virtualbox' provider...
==> ubuntu18: Importing base box 'generic/ubuntu1804'...
==> ubuntu18: Matching MAC address for NAT networking...
==> ubuntu18: Setting the name of the VM: test_ubuntu18_1737979065436_47140
==> ubuntu18: Fixed port collision for 22 => 2222. Now on port 2200.
==> ubuntu18: Clearing any previously set network interfaces...
==> ubuntu18: Preparing network interfaces based on configuration...
    ubuntu18: Adapter 1: nat
    ubuntu18: Adapter 2: hostonly
==> ubuntu18: Forwarding ports...
    ubuntu18: 22 (guest) => 2200 (host) (adapter 1)
==> ubuntu18: Running 'pre-boot' VM customizations...
==> ubuntu18: Booting VM...
==> ubuntu18: Waiting for machine to boot. This may take a few minutes...
    ubuntu18: SSH address: 127.0.0.1:2200
    ubuntu18: SSH username: vagrant
    ubuntu18: SSH auth method: private key
    ubuntu18: 
    ubuntu18: Vagrant insecure key detected. Vagrant will automatically replace
    ubuntu18: this with a newly generated keypair for better security.
    ubuntu18: 
    ubuntu18: Inserting generated public key within guest...
    ubuntu18: Removing insecure key from the guest if it's present...
    ubuntu18: Key inserted! Disconnecting and reconnecting using new SSH key...
==> ubuntu18: Machine booted and ready!
==> ubuntu18: Checking for guest additions in VM...
    ubuntu18: The guest additions on this VM do not match the installed version of
    ubuntu18: VirtualBox! In most cases this is fine, but in rare cases it can
    ubuntu18: prevent things such as shared folders from working properly. If you see
    ubuntu18: shared folder errors, please make sure the guest additions within the
    ubuntu18: virtual machine match the version of VirtualBox you have installed on
    ubuntu18: your host and reload your VM.
    ubuntu18: 
    ubuntu18: Guest Additions Version: 5.2.42
    ubuntu18: VirtualBox Version: 7.0
==> ubuntu18: Setting hostname...
==> ubuntu18: Configuring and enabling network interfaces...
==> ubuntu18: Running provisioner: ansible...
    ubuntu18: Running ansible-playbook...
PYTHONUNBUFFERED=1 ANSIBLE_FORCE_COLOR=true ANSIBLE_HOST_KEY_CHECKING=false ANSIBLE_SSH_ARGS='-o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o ControlMaster=auto -o ControlPersist=60s' ansible-playbook --connection=ssh --timeout=30 --limit="ubuntu18" --inventory-file=/test/.vagrant/provisioners/ansible/inventory --extra-vars=\{\"target_host\":\"ubuntu18\"\} -vvv ansible/nix-local-users.yml
ansible-playbook [core 2.17.7]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/study/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/study/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible-playbook
  python version = 3.12.3 (main, Jan 17 2025, 18:03:48) [GCC 13.3.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True
Using /etc/ansible/ansible.cfg as config file
host_list declined parsing /test/.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory as it did not pass its verify_file() method
script declined parsing /test/.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory as it did not pass its verify_file() method
auto declined parsing /test/.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory as it did not pass its verify_file() method
Parsed /test/.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory inventory source with ini plugin
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.

PLAYBOOK: nix-local-users.yml **************************************************
1 plays in ansible/nix-local-users.yml

PLAY [ubuntu18] ****************************************************************

TASK [Gathering Facts] *********************************************************
task path: /test/ansible/nix-local-users.yml:2
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: study
<127.0.0.1> EXEC /bin/sh -c 'echo ~study && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/study/.ansible/tmp `"&& mkdir "` echo /home/study/.ansible/tmp/ansible-tmp-1737979102.1509817-523943-230847070365236 `" && echo ansible-tmp-1737979102.1509817-523943-230847070365236="` echo /home/study/.ansible/tmp/ansible-tmp-1737979102.1509817-523943-230847070365236 `" ) && sleep 0'
<ubuntu18> Attempting python interpreter discovery
<127.0.0.1> EXEC /bin/sh -c 'echo PLATFORM; uname; echo FOUND; command -v '"'"'python3.12'"'"'; command -v '"'"'python3.11'"'"'; command -v '"'"'python3.10'"'"'; command -v '"'"'python3.9'"'"'; command -v '"'"'python3.8'"'"'; command -v '"'"'python3.7'"'"'; command -v '"'"'/usr/bin/python3'"'"'; command -v '"'"'python3'"'"'; echo ENDFOUND && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3.12 && sleep 0'
<ubuntu18> Python interpreter discovery fallback (unsupported Linux distribution: ubuntu)
Using module file /usr/lib/python3/dist-packages/ansible/modules/setup.py
<127.0.0.1> PUT /home/study/.ansible/tmp/ansible-local-5239273kodvnsp/tmpxuv0pdbw TO /home/study/.ansible/tmp/ansible-tmp-1737979102.1509817-523943-230847070365236/AnsiballZ_setup.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/study/.ansible/tmp/ansible-tmp-1737979102.1509817-523943-230847070365236/ /home/study/.ansible/tmp/ansible-tmp-1737979102.1509817-523943-230847070365236/AnsiballZ_setup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S -n  -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-cgihllizftbsohvxjezexndfhosuwwji ; /usr/bin/python3.12 /home/study/.ansible/tmp/ansible-tmp-1737979102.1509817-523943-230847070365236/AnsiballZ_setup.py'"'"' && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/study/.ansible/tmp/ansible-tmp-1737979102.1509817-523943-230847070365236/ > /dev/null 2>&1 && sleep 0'
[WARNING]: Platform linux on host ubuntu18 is using the discovered Python
interpreter at /usr/bin/python3.12, but future installation of another Python
interpreter could change the meaning of that path. See
https://docs.ansible.com/ansible-
core/2.17/reference_appendices/interpreter_discovery.html for more information.
ok: [ubuntu18]

TASK [Create a local nix users] ************************************************
task path: /test/ansible/nix-local-users.yml:10
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: study
<127.0.0.1> EXEC /bin/sh -c 'echo ~study && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/study/.ansible/tmp `"&& mkdir "` echo /home/study/.ansible/tmp/ansible-tmp-1737979102.789001-524110-46585659397742 `" && echo ansible-tmp-1737979102.789001-524110-46585659397742="` echo /home/study/.ansible/tmp/ansible-tmp-1737979102.789001-524110-46585659397742 `" ) && sleep 0'
Using module file /usr/lib/python3/dist-packages/ansible/modules/user.py
<127.0.0.1> PUT /home/study/.ansible/tmp/ansible-local-5239273kodvnsp/tmpv012owpg TO /home/study/.ansible/tmp/ansible-tmp-1737979102.789001-524110-46585659397742/AnsiballZ_user.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/study/.ansible/tmp/ansible-tmp-1737979102.789001-524110-46585659397742/ /home/study/.ansible/tmp/ansible-tmp-1737979102.789001-524110-46585659397742/AnsiballZ_user.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S -n  -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-mleatpfjsqwveasahcifudyghhrkuzwq ; /usr/bin/python3.12 /home/study/.ansible/tmp/ansible-tmp-1737979102.789001-524110-46585659397742/AnsiballZ_user.py'"'"' && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/study/.ansible/tmp/ansible-tmp-1737979102.789001-524110-46585659397742/ > /dev/null 2>&1 && sleep 0'
ok: [ubuntu18] => (item={'login': 'LocalUser1', 'password': '1Passw0rd@'}) => {
    "ansible_loop_var": "item",
    "append": false,
    "changed": false,
    "comment": "",
    "group": 1002,
    "home": "/home/LocalUser1",
    "invocation": {
        "module_args": {
            "append": false,
            "authorization": null,
            "comment": null,
            "create_home": true,
            "expires": null,
            "force": false,
            "generate_ssh_key": null,
            "group": null,
            "groups": null,
            "hidden": null,
            "home": null,
            "local": null,
            "login_class": null,
            "move_home": false,
            "name": "LocalUser1",
            "non_unique": false,
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "password_expire_max": null,
            "password_expire_min": null,
            "password_expire_warn": null,
            "password_lock": null,
            "profile": null,
            "remove": false,
            "role": null,
            "seuser": null,
            "shell": null,
            "skeleton": null,
            "ssh_key_bits": 0,
            "ssh_key_comment": "ansible-generated on Dev",
            "ssh_key_file": null,
            "ssh_key_passphrase": null,
            "ssh_key_type": "rsa",
            "state": "present",
            "system": false,
            "uid": null,
            "umask": null,
            "update_password": "always"
        }
    },
    "item": {
        "login": "LocalUser1",
        "password": "1Passw0rd@"
    },
    "move_home": false,
    "name": "LocalUser1",
    "password": "NOT_LOGGING_PASSWORD",
    "shell": "/bin/sh",
    "state": "present",
    "uid": 1002
}
<127.0.0.1> EXEC /bin/sh -c 'echo ~study && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/study/.ansible/tmp `"&& mkdir "` echo /home/study/.ansible/tmp/ansible-tmp-1737979102.9724927-524110-48708649402064 `" && echo ansible-tmp-1737979102.9724927-524110-48708649402064="` echo /home/study/.ansible/tmp/ansible-tmp-1737979102.9724927-524110-48708649402064 `" ) && sleep 0'
Using module file /usr/lib/python3/dist-packages/ansible/modules/user.py
<127.0.0.1> PUT /home/study/.ansible/tmp/ansible-local-5239273kodvnsp/tmp4tqlyxfh TO /home/study/.ansible/tmp/ansible-tmp-1737979102.9724927-524110-48708649402064/AnsiballZ_user.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/study/.ansible/tmp/ansible-tmp-1737979102.9724927-524110-48708649402064/ /home/study/.ansible/tmp/ansible-tmp-1737979102.9724927-524110-48708649402064/AnsiballZ_user.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S -n  -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-bcaxqjzbaqhsvieolltmbltywjjyhyke ; /usr/bin/python3.12 /home/study/.ansible/tmp/ansible-tmp-1737979102.9724927-524110-48708649402064/AnsiballZ_user.py'"'"' && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/study/.ansible/tmp/ansible-tmp-1737979102.9724927-524110-48708649402064/ > /dev/null 2>&1 && sleep 0'
ok: [ubuntu18] => (item={'login': 'LocalUser2', 'password': '2Passw0rd@'}) => {
    "ansible_loop_var": "item",
    "append": false,
    "changed": false,
    "comment": "",
    "group": 1003,
    "home": "/home/LocalUser2",
    "invocation": {
        "module_args": {
            "append": false,
            "authorization": null,
            "comment": null,
            "create_home": true,
            "expires": null,
            "force": false,
            "generate_ssh_key": null,
            "group": null,
            "groups": null,
            "hidden": null,
            "home": null,
            "local": null,
            "login_class": null,
            "move_home": false,
            "name": "LocalUser2",
            "non_unique": false,
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "password_expire_max": null,
            "password_expire_min": null,
            "password_expire_warn": null,
            "password_lock": null,
            "profile": null,
            "remove": false,
            "role": null,
            "seuser": null,
            "shell": null,
            "skeleton": null,
            "ssh_key_bits": 0,
            "ssh_key_comment": "ansible-generated on Dev",
            "ssh_key_file": null,
            "ssh_key_passphrase": null,
            "ssh_key_type": "rsa",
            "state": "present",
            "system": false,
            "uid": null,
            "umask": null,
            "update_password": "always"
        }
    },
    "item": {
        "login": "LocalUser2",
        "password": "2Passw0rd@"
    },
    "move_home": false,
    "name": "LocalUser2",
    "password": "NOT_LOGGING_PASSWORD",
    "shell": "/bin/sh",
    "state": "present",
    "uid": 1003
}
<127.0.0.1> EXEC /bin/sh -c 'echo ~study && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/study/.ansible/tmp `"&& mkdir "` echo /home/study/.ansible/tmp/ansible-tmp-1737979103.0961325-524110-27042937232436 `" && echo ansible-tmp-1737979103.0961325-524110-27042937232436="` echo /home/study/.ansible/tmp/ansible-tmp-1737979103.0961325-524110-27042937232436 `" ) && sleep 0'
Using module file /usr/lib/python3/dist-packages/ansible/modules/user.py
<127.0.0.1> PUT /home/study/.ansible/tmp/ansible-local-5239273kodvnsp/tmpk4vulkhv TO /home/study/.ansible/tmp/ansible-tmp-1737979103.0961325-524110-27042937232436/AnsiballZ_user.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/study/.ansible/tmp/ansible-tmp-1737979103.0961325-524110-27042937232436/ /home/study/.ansible/tmp/ansible-tmp-1737979103.0961325-524110-27042937232436/AnsiballZ_user.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S -n  -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-xyazghqxggmfaljuxketsxytgkcbtwuk ; /usr/bin/python3.12 /home/study/.ansible/tmp/ansible-tmp-1737979103.0961325-524110-27042937232436/AnsiballZ_user.py'"'"' && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/study/.ansible/tmp/ansible-tmp-1737979103.0961325-524110-27042937232436/ > /dev/null 2>&1 && sleep 0'
ok: [ubuntu18] => (item={'login': 'LocalUser3', 'password': '3Passw0rd@'}) => {
    "ansible_loop_var": "item",
    "append": false,
    "changed": false,
    "comment": "",
    "group": 1004,
    "home": "/home/LocalUser3",
    "invocation": {
        "module_args": {
            "append": false,
            "authorization": null,
            "comment": null,
            "create_home": true,
            "expires": null,
            "force": false,
            "generate_ssh_key": null,
            "group": null,
            "groups": null,
            "hidden": null,
            "home": null,
            "local": null,
            "login_class": null,
            "move_home": false,
            "name": "LocalUser3",
            "non_unique": false,
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "password_expire_max": null,
            "password_expire_min": null,
            "password_expire_warn": null,
            "password_lock": null,
            "profile": null,
            "remove": false,
            "role": null,
            "seuser": null,
            "shell": null,
            "skeleton": null,
            "ssh_key_bits": 0,
            "ssh_key_comment": "ansible-generated on Dev",
            "ssh_key_file": null,
            "ssh_key_passphrase": null,
            "ssh_key_type": "rsa",
            "state": "present",
            "system": false,
            "uid": null,
            "umask": null,
            "update_password": "always"
        }
    },
    "item": {
        "login": "LocalUser3",
        "password": "3Passw0rd@"
    },
    "move_home": false,
    "name": "LocalUser3",
    "password": "NOT_LOGGING_PASSWORD",
    "shell": "/bin/sh",
    "state": "present",
    "uid": 1004
}

PLAY RECAP *********************************************************************
ubuntu18                   : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

Por que ok=2 aqui? Havia 3 usuários, não 2. Quando vou para a máquina por ssh, não vejo usuários em /etc/passwd, /etc/shadow e não vejo novos diretórios home.

ubuntu
  • 1 respostas
  • 38 Views
Martin Hope
Dmitriano
Asked: 2025-01-24 19:22:58 +0800 CST

Execute ejabberd em um contêiner Docker

  • 5

No meu Ubuntu 24.04 criei um arquivo Docker experimental que instala ejabberd:

FROM ubuntu:24.04

RUN apt update
RUN apt -y install apt-utils
RUN apt -y install locales
RUN apt -y install nano

# Set the locale
RUN locale-gen en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8

RUN apt -y install openssl

RUN apt -y install ejabberd

Construa e execute

sudo docker build -t u24jabber .
sudo docker run -it --rm --name jabber -p 5280:5280 -p 5222:5222 -p 5269:5269 u24jabber

então dentro do contêiner docker eu executo

ejabberdctl status

e obteve o seguinte erro:

Failed RPC connection to the node ejabberd@localhost: nodedown

Meu primeiro palpite foi que ejabberdnão é executado e eu tentei

ejabberdctl start

dentro do contêiner docker, mas não ajudou.

Também tentei adicionar

CMD ["ejabberdctl", "foreground"]

para o arquivo Docker, mas sem sucesso e telnet 172.17.0.2 5280não conectou.

Qual é o Dockerfile mínimo que é executado ejabberdem sua configuração padrão?

ubuntu
  • 1 respostas
  • 51 Views
Martin Hope
medkinson
Asked: 2025-01-23 03:37:26 +0800 CST

Ubuntu - Postfix, Dovecot, Dnsmasq - Não é possível enviar e-mail

  • 5

Recentemente, tentei configurar vários SSLs para vários domínios usando o postfix SNI. (Dovecot permanece inalterado). Agora, estou recebendo erros de TLS (var/etc/mail.log):

Jan 22 22:06:17 2099047-cg00264 postfix/smtpd[138223]: connect from unknown[46.39.58.24]
Jan 22 22:06:17 2099047-cg00264 postfix/smtpd[138223]: warning: table hash:/etc/postfix/vmail_ssl.map.db: key history.tor: malformed BASE64 value: /FakeSSL/history.tor/history.t
Jan 22 22:06:17 2099047-cg00264 postfix/smtpd[138223]: warning: tls_server_sni_maps: history.tor map lookup problem
Jan 22 22:06:17 2099047-cg00264 postfix/smtpd[138223]: SSL_accept error from unknown[46.39.58.24]: -1
Jan 22 22:06:17 2099047-cg00264 postfix/smtpd[138223]: warning: TLS library problem: error:0A0000EA:SSL routines::callback failed:../ssl/statem/extensions.c:1000:
Jan 22 22:06:17 2099047-cg00264 postfix/smtpd[138223]: lost connection after STARTTLS from unknown[46.39.58.24]
Jan 22 22:06:17 2099047-cg00264 postfix/smtpd[138223]: disconnect from unknown[46.39.58.24] ehlo=1 starttls=0/1 commands=1/2

Meu postfix main.conf:

# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 3.6 on
# fresh installs.
compatibility_level = 3.6


smtpd_use_tls = yes
# TLS parameters
smtpd_tls_cert_file=/OtherSSL/mishkin.ml/mishkin.ml.chain.pem
smtpd_tls_key_file=/OtherSSL/mishkin.ml/mishkin.ml.priv.key
smtpd_tls_security_level=may

#smtp_tls_CApath=/OtherSSL/CA
smtp_tls_security_level=may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

smtpd_tls_auth_only = yes
smtpd_tls_wrappermode = no
smtpd_tls_mandatory_ciphers = high

tls_server_sni_maps = hash:/etc/postfix/vmail_ssl.map
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mishkin.ml
mydomain = mishkin.ml
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, mishkin.ml, 2099047-cg00264.twc1.net, localhost.twc1.net, localhost, history.tor
virtual_alias_domains = mishkin.ml, history.tor
virtual_alias_maps = hash:/etc/postfix/virtual
relayhost = 
mynetworks = 90.156.226.142/32
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all

vmail_ssl.map:

mishkin.ml /OtherSSL/mishkin.ml/mishkin.ml.chain.pem /OtherSSL/mishkin.ml/mishkin.ml.priv.key
history.tor /FakeSSL/history.tor/history.tor.chain.pem /FakeSSL/history.tor/history.tor.priv.key

Os SSLs foram criados usando https://github.com/Vinalti/Self-Signed-Certificates-Generator

  1. Tentou substituir ambos os arquivos smtpd_tls em um parâmetro smtpd_tls_chain_files
  2. Postfix movido para uma porta 25 (sim, movido DE 587 para 25)
  3. Seguiu outras instruções de configuração do SNI
  4. Tentei obter o certificado via openssl, não esse script
ubuntu
  • 1 respostas
  • 44 Views
Martin Hope
A. Smith
Asked: 2025-01-20 17:04:36 +0800 CST

Ubuntu 24.04 Não consigo desabilitar o acesso IPv6 SSH

  • 5

Tenho o Ubuntu 24.04 e estou usando IPv6 para certos serviços, mas não preciso dele para acesso ssh, e é por isso que estou tentando desabilitá-lo no serviço ssh, no entanto, especificar a família de endereços como "inet" não funciona mais como costumava funcionar no Ubuntu 22.04, estou esquecendo de algo? Além disso, tentei criar um arquivo de configuração totalmente separado para esse motivo em /etc/ssh/sshd_config.d/, mas não funcionou.

No Ubuntu 22.04, tudo o que eu precisava adicionar era adicionar 2 linhas em sshd_config (e funcionou todas as vezes): AddressFamily inet

OuvirEndereço 0.0.0.0

ubuntu
  • 1 respostas
  • 24 Views
Martin Hope
Cromulent
Asked: 2025-01-11 21:37:12 +0800 CST

mod_status mostra a página 404 do WordPress

  • 5
<Location /server-status>
        SetHandler server-status
        Require local
</Location>

# Keep track of extended status information for each request
ExtendedStatus On

Isso está no meu /etc/apache2/mods-enabled/status.conf

Obviamente, quando tento acessar isso do meu computador doméstico, falha, mas se eu adicionar Permitir tudo e remover Exigir local e for para /server-status, ele mostra a página 404 do Wordpress, o que é estranho.

Não tenho certeza do que preciso alterar para que seja exibida a página mod_status real em vez da página 404 do Wordpress.

Se precisar de mais informações, por favor me avise.

ubuntu
  • 1 respostas
  • 38 Views
Martin Hope
VPNer
Asked: 2025-01-10 01:40:25 +0800 CST

Como mover um servidor Ubuntu para um contêiner independente de quais serviços estão em execução?

  • 5

Tenho um servidor Ubuntu em bare metal que foi configurado por terceiros. Ele executa um serviço proprietário. Não há documentação adequada sobre o que está sendo executado e como.

Tive que redirecionar este servidor para outro serviço, um servidor Ubuntu com contêineres Docker executando o novo serviço.

Preciso executar o serviço proprietário anterior que estava sendo executado no servidor bare metal. Também preciso executá-lo em um contêiner para facilitar a implantação e o gerenciamento.

Não tenho certeza de como mover um servidor Ubuntu para contêineres.

Eu sei que esse não é o "jeito Docker" de fazer isso.

Uma abordagem que encontrei é criar uma imagem do zero e transferir o sistema de arquivos, exceto as seguintes pastas: /proc, /sys, /dev, /tmp, /mnt, /media, /run, /boot e /swapfile

FROM scratch
ADD folders-to-transfer.tar.gz /
CMD ["/bin/bash"]

Esta é a maneira correta?

Outros sugeriram usar uma VM, o que parece exagero.

ubuntu
  • 1 respostas
  • 27 Views

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Você pode passar usuário/passar para autenticação básica HTTP em parâmetros de URL?

    • 5 respostas
  • Marko Smith

    Ping uma porta específica

    • 18 respostas
  • Marko Smith

    Verifique se a porta está aberta ou fechada em um servidor Linux?

    • 7 respostas
  • Marko Smith

    Como automatizar o login SSH com senha?

    • 10 respostas
  • Marko Smith

    Como posso dizer ao Git para Windows onde encontrar minha chave RSA privada?

    • 30 respostas
  • Marko Smith

    Qual é o nome de usuário/senha de superusuário padrão para postgres após uma nova instalação?

    • 5 respostas
  • Marko Smith

    Qual porta o SFTP usa?

    • 6 respostas
  • Marko Smith

    Linha de comando para listar usuários em um grupo do Windows Active Directory?

    • 9 respostas
  • Marko Smith

    O que é um arquivo Pem e como ele difere de outros formatos de arquivo de chave gerada pelo OpenSSL?

    • 3 respostas
  • Marko Smith

    Como determinar se uma variável bash está vazia?

    • 15 respostas
  • Martin Hope
    Davie Ping uma porta específica 2009-10-09 01:57:50 +0800 CST
  • Martin Hope
    kernel O scp pode copiar diretórios recursivamente? 2011-04-29 20:24:45 +0800 CST
  • Martin Hope
    Robert ssh retorna "Proprietário incorreto ou permissões em ~/.ssh/config" 2011-03-30 10:15:48 +0800 CST
  • Martin Hope
    Eonil Como automatizar o login SSH com senha? 2011-03-02 03:07:12 +0800 CST
  • Martin Hope
    gunwin Como lidar com um servidor comprometido? 2011-01-03 13:31:27 +0800 CST
  • Martin Hope
    Tom Feiner Como posso classificar a saída du -h por tamanho 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich O que é um arquivo Pem e como ele difere de outros formatos de arquivo de chave gerada pelo OpenSSL? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent Como determinar se uma variável bash está vazia? 2009-05-13 09:54:48 +0800 CST

Hot tag

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve