In this paper, we use the finite state automata to count the number of restricted permutations and the number of restricted variations. For each type of restricted permutations, we construct a finite state automaton able to recognize and enumerate them. We, also, discuss how it encompasses the other known methods for enumerating permutations with restricted position, and in one case, we establish connections with some other combinatorial structures, such as subsets and compositions.