#include
#include
#define PASSMAX 8
int main(void) {
struct termios defrsett, newrsett;
char password[PASSMAX + 1];
tcgetattr(fileno(stdin), &defrsett);
newrsett = defrsett;
newrsett.c_lflag &= ~ECHO;
printf("Enter password: ");
if(tcsetattr(fileno(stdin), TCSAFLUSH, &newrsett) != 0)
fprintf(stderr, "Did not set attributes\n");
else {
fgets(password, PASSMAX, stdin);
tcsetattr(fileno(stdin), TCSANOW, &defrsett);
fprintf(stdout, "\nYou enterd %s", password);
}
return 0;
}