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 / user-28916

Darrell Brogdon's questions

Martin Hope
Darrell Brogdon
Asked: 2024-07-25 02:13:59 +0800 CST

Por que estou recebendo uma “Permissão negada (chave pública)” no Azure Ubuntu?

  • 7

Tenho um servidor Ubuntu 24.04 configurado no Azure. A chave gerada quando configurei a instância funciona. Criei então um novo usuário (dbrogdon) e gerei uma nova chave com o mesmo tipo de chave (Ed25519). Em seguida, copiei a chave pública para ~dbrogdon/.ssh/authorized_keys e alterei as permissões para o seguinte:

drwx------ 2 dbrogdon dbrogdon 4.0K Jul 24 17:21 .
drwxr-x--- 3 dbrogdon dbrogdon 4.0K Jul 24 17:22 ..
-rw------- 1 dbrogdon dbrogdon  104 Jul 24 17:20 authorized_keys

No meu Mac, tenho a chave privada com as seguintes permissões:

-rw-------  1 dbrogdon  staff   419B Jul 24 10:51 dbrogdon-key.pem

Quando tento fazer ssh do meu Mac para o servidor, recebo o seguinte:

debug1: Host 'xxxxxxx' is known and matches the ED25519 host key.
debug1: Found key in /Users/dbrogdon/.ssh/known_hosts:53
debug1: ssh_packet_send2_wrapped: resetting send seqnr 3
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: Sending SSH2_MSG_EXT_INFO
debug1: expecting SSH2_MSG_NEWKEYS
debug1: ssh_packet_read_poll2: resetting read seqnr 3
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_ext_info_client_parse: server-sig-algs=<ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],rsa-sha2-512,rsa-sha2-256>
debug1: kex_ext_info_check_ver: [email protected]=<0>
debug1: kex_ext_info_check_ver: [email protected]=<0>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_ext_info_client_parse: server-sig-algs=<ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],rsa-sha2-512,rsa-sha2-256>
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.

Aqui está o auth.log para essa sessão:

2024-07-24T18:09:51.877109+00:00 xxxxxxx sshd[3349]: Connection from 71.205.127.54 port 52988 on 10.1.0.4 port 22 rdomain ""
2024-07-24T18:09:51.877153+00:00 xxxxxxx sshd[3349]: debug1: Local version string SSH-2.0-OpenSSH_9.6p1 Ubuntu-3ubuntu13.4
2024-07-24T18:09:51.877191+00:00 xxxxxxx sshd[3349]: debug1: Remote protocol version 2.0, remote software version OpenSSH_9.6
2024-07-24T18:09:51.877240+00:00 xxxxxxx sshd[3349]: debug1: compat_banner: match: OpenSSH_9.6 pat OpenSSH* compat 0x04000000
2024-07-24T18:09:51.877917+00:00 xxxxxxx sshd[3349]: debug1: permanently_set_uid: 105/65534 [preauth]
2024-07-24T18:09:51.877973+00:00 xxxxxxx sshd[3349]: debug1: list_hostkey_types: rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
2024-07-24T18:09:51.878017+00:00 xxxxxxx sshd[3349]: debug1: SSH2_MSG_KEXINIT sent [preauth]
2024-07-24T18:09:51.947718+00:00 xxxxxxx sshd[3349]: debug1: SSH2_MSG_KEXINIT received [preauth]
2024-07-24T18:09:51.947838+00:00 xxxxxxx sshd[3349]: debug1: kex: algorithm: [email protected] [preauth]
2024-07-24T18:09:51.947929+00:00 xxxxxxx sshd[3349]: debug1: kex: host key algorithm: ssh-ed25519 [preauth]
2024-07-24T18:09:51.947984+00:00 xxxxxxx sshd[3349]: debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none [preauth]
2024-07-24T18:09:51.948032+00:00 xxxxxxx sshd[3349]: debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none [preauth]
2024-07-24T18:09:51.948082+00:00 xxxxxxx sshd[3349]: debug1: expecting SSH2_MSG_KEX_ECDH_INIT [preauth]
2024-07-24T18:09:52.033019+00:00 xxxxxxx sshd[3349]: debug1: SSH2_MSG_KEX_ECDH_INIT received [preauth]
2024-07-24T18:09:52.044766+00:00 xxxxxxx sshd[3349]: debug1: ssh_packet_send2_wrapped: resetting send seqnr 3 [preauth]
2024-07-24T18:09:52.044927+00:00 xxxxxxx sshd[3349]: debug1: rekey out after 134217728 blocks [preauth]
2024-07-24T18:09:52.044976+00:00 xxxxxxx sshd[3349]: debug1: SSH2_MSG_NEWKEYS sent [preauth]
2024-07-24T18:09:52.045012+00:00 xxxxxxx sshd[3349]: debug1: Sending SSH2_MSG_EXT_INFO [preauth]
2024-07-24T18:09:52.045047+00:00 xxxxxxx sshd[3349]: debug1: expecting SSH2_MSG_NEWKEYS [preauth]
2024-07-24T18:09:52.145161+00:00 xxxxxxx sshd[3349]: debug1: ssh_packet_read_poll2: resetting read seqnr 3 [preauth]
2024-07-24T18:09:52.145271+00:00 xxxxxxx sshd[3349]: debug1: SSH2_MSG_NEWKEYS received [preauth]
2024-07-24T18:09:52.145321+00:00 xxxxxxx sshd[3349]: debug1: rekey in after 134217728 blocks [preauth]
2024-07-24T18:09:52.145366+00:00 xxxxxxx sshd[3349]: debug1: KEX done [preauth]
2024-07-24T18:09:52.145417+00:00 xxxxxxx sshd[3349]: debug1: SSH2_MSG_EXT_INFO received [preauth]
2024-07-24T18:09:52.145475+00:00 xxxxxxx sshd[3349]: debug1: kex_ext_info_check_ver: [email protected]=<0> [preauth]
2024-07-24T18:09:52.325543+00:00 xxxxxxx sshd[3349]: debug1: userauth-request for user dbrogdon service ssh-connection method none [preauth]
2024-07-24T18:09:52.325656+00:00 xxxxxxx sshd[3349]: debug1: attempt 0 failures 0 [preauth]
2024-07-24T18:09:52.326541+00:00 xxxxxxx sshd[3349]: debug1: PAM: initializing for "dbrogdon"
2024-07-24T18:09:52.328243+00:00 xxxxxxx sshd[3349]: debug1: PAM: setting PAM_RHOST to "71.205.127.54"
2024-07-24T18:09:52.328320+00:00 xxxxxxx sshd[3349]: debug1: PAM: setting PAM_TTY to "ssh"
2024-07-24T18:09:52.328369+00:00 xxxxxxx sshd[3349]: debug1: kex_server_update_ext_info: Sending SSH2_MSG_EXT_INFO [preauth]
2024-07-24T18:09:52.397374+00:00 xxxxxxx sshd[3349]: Connection closed by authenticating user dbrogdon 71.205.127.54 port 52988 [preauth]
2024-07-24T18:09:52.397473+00:00 xxxxxxx sshd[3349]: debug1: do_cleanup [preauth]
2024-07-24T18:09:52.397793+00:00 xxxxxxx sshd[3349]: debug1: monitor_read_log: child log fd closed
2024-07-24T18:09:52.397848+00:00 xxxxxxx sshd[3349]: debug1: do_cleanup
2024-07-24T18:09:52.397924+00:00 xxxxxxx sshd[3349]: debug1: PAM: cleanup
2024-07-24T18:09:52.398518+00:00 xxxxxxx sshd[3349]: debug1: Killing privsep child 3350
2024-07-24T18:09:52.398567+00:00 xxxxxxx sshd[3349]: debug1: audit_event: unhandled event 12

Aqui está o comando que estou usando para conectar:

ssh -v -o PubkeyAuthentication=no -i ./dbrogdon-key.pem [email protected]

Há algo que perdi ao configurar este usuário? Nunca tive esse problema antes em outros sistemas, então estou me perguntando se não há algo específico do Azure.

ssh
  • 1 respostas
  • 191 Views
Martin Hope
Darrell Brogdon
Asked: 2022-01-23 18:16:19 +0800 CST

Como fazer o mod_rewrite forçar um redirecionamento?

  • 1

Preciso redirecionar temporariamente meu site para uma versão estática hospedada na Cloudflare. O site atual é um site Wordpress hospedado em Ionos e Wordpress parece estar fazendo um redirecionamento 301 de mydomain.compara www.mydomain.com. Eu gostaria de poder continuar acessando a instância do Wordpress indo para www.mydomain.commas se eu (ou qualquer outra pessoa) for para mydomain.comeu gostaria de ser redirecionado para static.mydomain.com.

Coloquei isso no meu .htaccessarquivo:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mydomain.com
RewriteCond %{HTTP_HOST} !^www.mydomain.com
RewriteRule ^(.*) https://static.mydomain.com/$1 [R=302,L]
</IfModule>

No entanto, quando eu visito mydomain.com, ainda sou redirecionado www.mydomain.com, então parece que o .htaccess RewriteRule não está sendo acionado e, portanto, o Wordpress está fazendo seu redirecionamento.

Existe alguma maneira em .htaccess (não tenho acesso ao arquivo de configuração do Apache) para forçar um redirecionamento como estou descrevendo?

.htaccess mod-rewrite apache2
  • 1 respostas
  • 50 Views
Martin Hope
Darrell Brogdon
Asked: 2021-11-02 08:42:24 +0800 CST

Como fazer um redirecionamento nginx excluindo um endereço IP e um caminho?

  • 0

Preciso redirecionar para uma URL, a menos que o usuário esteja vindo de nosso endereço IP interno ou esteja acessando um caminho específico.

Eu tentei isso:

location ~* /foobar {
    break;
}

location ~* / {
    if ($remote_addr != 111.222.333.444) {
        rewrite ^ https://external.tld/
    }
}

Mas isso não parece funcionar. Essa configuração específica causa um 404 ao acessar https://mydomain.tld/foobar e um "Bem-vindo ao nginx!" página ao acessá-lo de dentro do nosso endereço IP. No entanto, acessar https://mydomain.tld/foobar fora do nosso endereço IP redireciona corretamente para https://external.tld/

nginx
  • 1 respostas
  • 337 Views
Martin Hope
Darrell Brogdon
Asked: 2015-08-26 15:41:49 +0800 CST

O usuário do MySQL não pode se conectar do host remoto

  • 2

Eu tenho dois usuários do MySQL com exatamente as mesmas permissões, um pode se conectar de um host remoto, o outro não. Como pode ser isso?

Aqui está a minha configuração:

SELECT * FROM user WHERE user IN ('baduser','gooduser')  AND host='%';

Resulta em:

Host    User        Password    Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv   Reload_priv Shutdown_priv   Process_priv    File_priv   Grant_priv  References_priv Index_priv  Alter_priv  Show_db_priv    Super_priv  Create_tmp_table_priv   Lock_tables_priv    Execute_priv    Repl_slave_priv Repl_client_priv    Create_view_priv    Show_view_priv  Create_routine_priv Alter_routine_priv  Create_user_priv    Event_priv  Trigger_priv    Create_tablespace_priv  ssl_type    ssl_cipher  x509_issuer x509_subject    max_questions   max_updates max_connections max_user_connections    plugin  authentication_string   password_expired
%       gooduser    *PASS1      Y           N           N           N           N           N           N           N               N               N           N           N               N           N           N               N           N                       N                   N               N               N                   N                   N               N                   N                   N                   N           N               N                       0           0           0           0               NULL            N
%       baduser     *PASS2      Y           N           N           N           N           N           N           N               N               N           N           N               N           N           N               N           N                       N                   N               N               N                   N                   N               N                   N                   N                   N           N               N                       0           0           0           0               NULL            N

No entanto, quando eu faço login como 'baduser' do host remoto...

mysql -h 999.888.777.666 -u baduser -p my_db

Estou tendo o erro a seguir:

ERROR 1045 (28000): Access denied for user 'baduser'@'111.222.333.444' (using password: YES)
mysql
  • 1 respostas
  • 91 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