Generation of electron-acoustic waves in the magnetosphere