Enviado em 19/01/2015 - 10:43h
Olá pessoal,#include <stdio.h>
#include <libssh.h>
int main()
{
char *user = "usuario";
char *password = "minhasenha";
const char *host = "192.168.1.10";
const int port = 22;
int rc;
int verbosity = SSH_LOG_PROTOCOL;
int v = 1;
ssh_session my_ssh_session;
my_ssh_session = ssh_new();
if (my_ssh_session == NULL)
return(-1);
ssh_options_set(my_ssh_session, SSH_OPTIONS_SSH2, &v);
ssh_options_set(my_ssh_session, SSH_OPTIONS_HOST, host);
ssh_options_set(my_ssh_session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity);
ssh_options_set(my_ssh_session, SSH_OPTIONS_PORT, &port);
ssh_options_set(my_ssh_session, SSH_OPTIONS_USER, user);
rc = ssh_connect(my_ssh_session);
if (rc != SSH_OK)
{
fprintf(stderr,"Error connecting to host %s\n",ssh_get_error(my_ssh_session));
ssh_free(my_ssh_session);
return(-1);
}
rc = ssh_userauth_password(my_ssh_session, user, password);
if (rc == SSH_AUTH_SUCCESS)
{
printf("Authenticated correctly");
}
}
O que é o THP na configuração de RAM do Linux e quando desabilitá-lo
Comparação entre os escalonadores BFQ e MQ-Deadline (acesso a disco) no Arch e Debian
Conciliando o uso da ZRAM e SWAP em disco na sua máquina
Servidor de Backup com Ubuntu Server 24.04 LTS, RAID e Duplicati (Dell PowerEdge T420)
Como unir duas coleções de ROMs preservando as versões traduzidas (sem duplicatas)
Como instalar o Telegram Desktop no Ubuntu 24.04
Overclocking Permanente para Drastic no Miyoo Mini Plus
Problemas de chaves (/usr/share/keyrings) no Debian
Converter os repositórios Debian para o novo formato com as chaves
Browser/Placa de vídeo trava Ubuntu 22.04 (1)
Salvar estado da VM no virt-manager [RESOLVIDO] (5)