I've read about generating 2 keys (private and public) on client host and copying the public key to the server host.
As I understand it, (correct me if i'm wrong): The server encrypts data with the public key and sends it to client, the client decrypts it with the private key.
But if I need to encrypt data on the client for sending to the server, how does it happen?
The public key encrypts data on the client? But how can the server decrypt it, if it only has the public key?
How does SSH encryption work?