Usar o bash builtin para verificar portas abertas também pode funcionar:
#!/bin/bash
host_file=/path/to/file.txt
out_file=/path/to/out.txt
while read -r ip; do
if timeout 5 bash -c "cat < /dev/null >/dev/tcp/${ip}/22"; then
echo -e "${ip}\tSuccess"
else
echo -e "${ip}\tFailure"
fi >> "$out_file"
done < "$host_file"