#include
#include
int main(char ip[20]){
FILE* fp=NULL;
fp=fopen("passwd.txt","r");
char buff[200];
int i;
for(i=0;;i++){
memset(buff,0,sizeof(buff));
if(fp==NULL)
break;
fgets(buff,10,fp);
printf("%s",buff);
char shell[200];
sprintf(shell,"/home/hht/workspeace/work1/ssh.sh%s%s",ip,buff);
system("shell");
}
}
至于shell那段,我完全不会,在现摸索现用,不知道对不对
abcdefg
段错误 (核心已转储)
我向让这个程序把passwd里面的一行一行密码抓出来,然后输进脚本里,让脚本用C语言的IP和密码来SSH