Let GG be a graph with vertex set V(G)V(G), ff a permutation of V(G)V(G). Define δf(x,y)=|d(x,y)−d(f(x),f(y))|δf(x,y)=∣∣d(x,y)−d(f(x),f(y))∣∣ and δf(G)=∑δf(x,y)δf(G)=∑δf(x,y), where the sum is taken over all unordered pairs xx, yy of distinct vertices of GG. Let π(G)π(G) denote the smallest positive value of δf(G)δf(G) among all permutations ff of V(G)V(G). A permutation ff with δf(G)=π(G)δf(G)=π(G) is called a near automorphism of GG. In this paper, the near automorphisms of the complement or the square of a cycle are characterized. Moreover, π(¯Cn)π(¯¯¯¯¯¯Cn) and π(C2n)π(C2n) are determined.