Hello @Anjaneya, Visakh,
welcome to this moderated Azure community forum.
Azure IoT (edge) is mainly focused on sending device-to-cloud messages and offering two-way communication for cloud-to-device control.
If you want to access your ubuntu or windows remotely, you need to use extra tooling.
A solution we use for multiple customers is based on auto ssh and is custom built.
It offers ssh over an outbound port to a 'stepping stone' so the IoT device cannot be attacked.
The stepping stone (or jump box) is based on a VM in the cloud, only reachable for known IoT device IP ranges.
Azure also offers Azure Arc.
Azure Arc-enabled servers lets you manage Windows and Linux physical servers and virtual machines hosted outside of Azure, on your corporate network, or other cloud provider. For the purposes of Azure Arc, these machines hosted outside of Azure are considered hybrid machines.
Just install an agent and your device is connected to the Azure Cloud.
Over that tunnel, you can use SSH to connect to the Arc enabled device..
SSH for Arc-enabled servers enables SSH based connections to Arc-enabled servers without requiring a public IP address or additional open ports.
If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.