How can I install samba via SSH access?

sudo apt-get update && sudo apt-get install smb-app-osmc will install and configure Samba for you.