Yes. You theoretically can.
All you need is for that Nucleo board to have
- some sort of network connectivity
- an IP stack, a TCP layer that uses that network hardware
- an SSH program that uses the above TCP/IP stack to connect to your server.
That's per se possible, but the way you asked indicates you might not be experienced enough to pull off the integration/software porting in reasonable time.
Also, there's other crypto protocols than SSH that are already available for such microcontrollers as yours – there's compact TLS implementations, for example. Building up an SSH connection for well-defined machine-to-machine comms also doesn't sound so effective. So, honestly, hardware is hard and software usually is easier, so change the whatever runs your SSH daemon to accept commands e.g. via a TLS endpoint, and you're removing a lot of the complexity. You'd still need to add networking hardware to your microcontroller, and make your TCP/IP stack talk to that, and you'd still have to learn how to use a TLS library in your microcontroller board, so that's really a lot of effort...
The project could admit the purchase of other hardware components if necessary (e.g. wifi modules).
Generally, this sounds like a job far better suited for a thing that comes with support for "fully fledged" operating systems, like a Raspberry Pi Zero, for example. There, you'll have no problem to just get an SSH client to do what you want.
So, consider that the hardware component you'd want to buy. It can possibly either replace the Nucleo board, or run alongside it, maybe even powered off, until communication becomes necessary.