I set mine up with NoMachine and with mounting to AWS FSx Windows SMB share.
sudo apt update
sudo apt -y upgrade
sudo apt install ubuntu-desktop
Transfer nomachine package to instance via WinSCP
sudo dpkg -i nomachine_6.10.12_1_amd64.deb
sudo mkdir .nx
sudo mkdir .nx/config
sudo cp -p .ssh/authorized_keys .nx/config/authorized.crt
sudo vi /etc/ssh/sshd_config
Hit i for insert
Set Password Authentication yes
Hit esc to get out of insert mode
:wq! to save
then, to set password for ubuntu account:
sudo /etc/init.d/ssh reload
sudo passwd ubuntu
to add new user:
sudo useradd newuser
to add user to the admin rights group:
usermod -aG sudo newuser
and this set new user password:
sudo passwd newuser
For FSx mounting the following is needed:
sudo apt-get install cifs-utils
then you have to edit the file ".smbcredentials" with the command:
vi ~/.smbcredentials
Hit i for insert
Paste the following information:
username=USERNAME
password=PASSWORD
domain=DOMAIN
Hit esc to get out of insert mode
:wq! to save
then in shell user prompt:
chmod 0600 ~/.smbcredentials
sudo mkdir /mnt/share
finally you have to edit "/etc/fstab" followion teese instructions:
sudo vi /etc/fstab
use:
$ to go to the end of the line in VI
i to insert
move to the next line and paste the following
//IPADDRESS/share /mnt/share cifs credentials=/home/ubuntu/.smbcredentials 0 0
*
Hit esc to get out of insert mode
:wq! to save
*
Remeber to execute:
sudo mount -a
To mount the FSx share