sahilamanu shared hosting, or managed VPS? I'm surprised you were able to install Composer globally on a shared hosting.
Does the shared hosting has any documentation on using Composer on their servers?
When I look up the error online it seems to be related to SSH. The connection might be timing out because there's some time with no activity between Composer output.
Your host might have documentation or support to help you with that. Otherwise if you have access to tools like screen
you could run Composer in a screen session so even if the SSH connection cuts it won't kill the command and you can connect back to it later.