27 But the anointing which you have received from Him abides in you, and you do not need that anyone teach you; but as the same anointing teaches you concerning all things, and is true, and is not a lie, and just as it has taught you, you will abide in Him. (NKJV)
The annointing refers to the Holy Spirit since it 1) was received from Jesus, 2) teaches you all things and 3) is true. These are references to John 16:5-15 (NKJV) (emphasis above & below mine):
5 “But now I [Jesus] go away to Him [the Father] who sent Me, and none of you asks Me, ‘Where are You going?’ 6 But because I have said these things to you, sorrow has filled your heart. 7 Nevertheless I tell you the truth. It is to your advantage that I go away; for if I do not go away, the Helper will not come to you; but if I depart, I will send Him to you. 8 And when He has come, He will convict the world of sin, and of righteousness, and of judgment: 9 of sin, because they do not believe in Me; 10 of righteousness, because I go to My Father and you see Me no more; 11 of judgment, because the ruler of this world is judged.
12 “I still have many things to say to you, but you cannot bear them now. 13 However, when He, the Spirit of truth, has come, He will guide you into all truth; for He will not speak on His own authority, but whatever He hears He will speak; and He will tell you things to come. 14 He will glorify Me, for He will take of what is Mine and declare it to you. 15 All things that the Father has are Mine. Therefore I said that He will take of Mine and declare it to you.
The anointing that was "received" and "abides in you" is later pointed out specifically to be the Spirit in 1 John 3:24 (NKJV):
24 Now he who keeps His commandments abides in Him, and He in him. And by this we know that He abides in us, by the Spirit whom He has given us.
God abides in you and teaches you via the Holy Spirit, the Spirit of truth.