I am posting a discussion on the quality of a Guru given in Linga Purana. Only that person who has a decisive knowledge of the Atman can be a Guru. Knowledge of scripture without direct experience of the Atman will not be of much use.
Quality of a Guru
The preceptor who is conversant with the scriptural texts, who is
intelligent, who is favorably disposed towards common people, who
performs penance, who is engaged in following accepted worldly
conventions and who knows the principles is known as one who bestows
salvation.
He may be endowed with all characteristic qualities; he may be an
expert in all sacred texts, and he may be conversant with all means
and modes, but if he is devoid of the real truth, all the other
qualities shall be futile to him.
If he has no decisive knowledge of the Atman which is self-evident
great principle, he is not blessed himself. How can he bless others?
The brahmin who is enlightened is pure and is capable of accomplishing
things. But whence can there be enlightenment in one who is devoid of
principles? Whence can there be comprehension of self? …………… Hence,
those liberated souls who are conversant with the principles
(realities) can redeem others. The principle that produces perfect
cognition originates from his greatest bliss.
Only he who has understood the truth can be a guide unto bliss and not
one who is a preceptor only in name but who is devoid of cognition.
Such people cannot redeem one another. Can a rock redeem another rock?
Those who have perfect cognition only in name can have salvation only
in name.
Command that causes the destruction of bonds is instantaneously born
by the sight and touch of the yogins or even by conversing with them.
Or, the preceptor may enter the physical body of the disciple by the
yogic path and enlighten him by means of the yogic power after
understanding all the entities.
Linga Purana II.20.34-43