Israeli soldiers opened fire on displaced Palestinians as thousands of people attempted to return to their homes in north Gaza.