Working method
ssh-add /home/rb/eta/ec2_ramesh_key.pem
In Connect to server do:
sftp://ec2-user@ec2-35-91-46-202.us-west-2.compute.amazonaws.com
To rename:
Right click >> Add to Bookmark
Then you can rename the bookmark
https://smashingweb.info/connect-remote-server-nautilus-using-key-file-pem-file/
gedit ~/.ssh/config
Well some info were already there ex. from VSCode
# Read more about SSH config files: https://linux.die.net/man/5/ssh_config
Host Automl6
HostName ec2-35-91-46-202.us-west-2.compute.amazonaws.com
User ec2-user
IdentityFile /home/rb/eta/ec2_ramesh_key.pem
Host Automl4
HostName ec2-54-187-190-154.us-west-2.compute.amazonaws.com
User ec2-user
IdentityFile /home/rb/eta/ec2_ramesh_key.pem
Host Automl5
HostName ec2-35-89-188-226.us-west-2.compute.amazonaws.com
User ec2-user
IdentityFile /home/rb/eta/ec2_ramesh_key.pem
do this in terminal:
ssh Automl4
This will get you connected to Amazon ec2 server
Then in Nautilus:
Ctrl+L
ssh://Automl4
https://ubuntu.com/tutorials/ubuntu-desktop-aws#2-setting-up-tightvnc-on-aws
https://ubuntu.com/tutorials/ubuntu-desktop-aws#4-aws-configuration
sudo apt update
sudo apt install ubuntu-desktop
sudo apt install tightvncserver
sudo apt install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal
vncserver :1
vi ~/.vnc/xstartup
Press the ‘i’ key on your keyboard
#!/bin/sh
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
gnome-terminal &
After you’re done, enter ‘Shift + :’ and type ‘wq’ to save and quit the file.
Now, let’s restart the VNC server by killing it first and then starting it up.
To kill the vnc server and start it again, type the following command:
vncserver -kill :1
vncserver :1
If killing doesn't work
The problem is that the vnc server crashed and it no longer has a pid file in the ~/.vnc. Even though there isn't a pid running it looks at the files in /tmp and thinks that there is a vncserver running on :1 because of the Xlock files. Just delete all the files in /tmp ex:
DO:
sudo rm -rf /tmp/*
sudo rm -rf /tmp/.*
AWS Configuration:
We need to make sure that the AWS instance has inbound rules setup to allow connection using VNC. So, head over to your AWS EC2 console and modify the inbound-rules. Add the entry : Custom TCP Rule | TCP | 5901 | Custom | 0.0.0.0/0 | VNC Connect
Changing inbound rules:
https://us-west-2.console.aws.amazon.com/ec2/v2/home?region=us-west-2#SecurityGroups:
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/ .
In the navigation pane, choose Security Groups. Select the security group for your instance.
Choose Inbound, Edit, Add Rule.
For Type, choose SSH.
In the Source field, specify the IPv6 address of your computer in CIDR notation. ...
Choose Save.