SSH_AUTH_SOCK environment variable not available to Rex
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
- Área
- devops, infrastructure
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
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
- Include a
Hostnamewith the IP address of the server - Ensure
ForwardAgentis "yes" for the server - 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
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de RexOps/Rex
-
is_redhat() misses Rocky/Alma/CentOS Stream/Oracle Linux lsb_release IDs -> pkg dies "OS/Provider not supported"Posiblemente ocupada @stantheman0128 la tomó hace 19 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
-
triage needed
Dificultad 3/5 1-2 días Aptitud para principiantes 42/100
-
Enable errors from Augeas to be retrievedQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abiertofeature request
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
Todos los issues de RexOps/Rex
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
jimsalterjrs/sanoid#1116 · 1 reacción ·
-
Add .gitattributes so share/skel keeps LF on a Windows git checkoutPosiblemente ocupada @sadhana-s-codez la tomó hace 3 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
PerlDancer/Dancer2#1854 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
major/MySQLTuner-perl#1007 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100