Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

SSH_AUTH_SOCK environment variable not available to Rex

Abierto
#1,615 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
git, perl

Línea de trabajo

Comienza reproduciendo el problema con una entrada de configuración de SSH que establezca Hostname en la IP del servidor y ForwardAgent en yes; después compara rex -H server PrintEnv con ssh -A server printenv. Rastrea la conexión SSH de Rex y la gestión del entorno remoto; se considera terminado cuando SSH_AUTH_SOCK está disponible a través de Rex y un git pull remoto se ejecuta correctamente con la autenticación reenviada.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

triage needed
Describe the bug

I ran into a bug where SSH ForwardAgent was enabled for a server, and I could run from the command-line

ssh -A server "cd /dir && git pull origin main"

but when running that git command in Rex (including using the SCM checkout function) did not work, and received a "Permission denied (public key)" error. See https://groups.google.com/g/rex-users/c/5FavxuXgeb0

The problem was caused by the .ssh/config having a Hostname parameter for the server that specified the IP address. Removing the Hostname fixed the issue.

Upon further investigation, I created a Rex task

task "PrintEnv" => sub {
     my $out = run "printenv";
     say $out if $out;
}

and compared using rex -H server PrintEnv with ssh -A server printenv

A notable difference is that the SSH_AUTH_SOCK environment variable was not set when run through Rex.

When removing the Hostname and re-running the Rex task, SSH_AUTH_SOCK was present. (This seems to have nothing to do with the .ssh/known_hosts although removing it the first time prompts SSH to accept the host fingerprint.)

Expected behavior

Git and other tools being run through Rex would have had their authentication forwarded.

How to reproduce it

For a .ssh/config of a particular server

  1. Include a Hostname with the IP address of the server
  2. Ensure ForwardAgent is "yes" for the server
  3. Run a Rex command on the server that requires forwarded authentication, e.g. git pull
Code example

No response

Additional context

No response

Rex version

1.14.3

Perl version

5.34.0

Operating system running rex

Linux (Ubuntu 22.04.1)

Operating system managed by rex

Linux (Ubuntu 18.04.6, Debian 6.1.85-1)

How rex was installed?

cpan client

Lenguaje dominante
Perl
Estrellas
736
Forks
217
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de RexOps/Rex

Todos los issues de RexOps/Rex

Issues similares

Más issues de Perl

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.