GH from MO's answer suggests to study (odd) composite numbers $m$ such that $\sigma_2(m)−1$ is a square. Therefore $\sigma_2(m)$ is not divisible by $4$ and has no (prime) divisors equal $3$ modulo $4$. Let $m=p_1^{a_1}\dots p_k^{a_k}$ be the prime decomposition of $m$. Then
$$\sigma_2(m)=(1+p_1^2+\dots+p_1^{2a_1})\dots (1+p_k^2+\dots+p_k^{2a_k})=$$ $$\frac{p_1^{2a_1+2}-1}{p_1^2-1}\cdots \frac{p_k^{2a_k+2}-1}{p_k^2-1}.$$
In particular, if $m$ is odd then no $a_i$ equals $2$ or $3$ modulo $4$ and at most one $a_i$ is odd (and in this case it equals $1$ modulo $8$). Moreover, for each natural $i\le k$ the greatest common divisor of $p_i^2-1$ and $a_i+1$ has no divisors $q$ equal $3$ modulo $4$, because otherwise $1+p_i^2+\dots+p_i^{2a_i}$ divides $q$.
Moreover, suppose that $\sigma_2(m)\equiv 2\pmod {10}$, as required. Then exactly one $a_i$, say, $a_1$ equals $1$ modulo $8$ and each other $a_i$ is divisible by $4$.
I am trying to advance this study farther.