To access the workstations from a non-sapienza network you have to use a VPN that you can download and setup by following the guide at this link.
After installing the VPN, connect to this server: castore.uniroma1.it
and use your sapienza credentials to login ([email protected]).
You can connect to all the machines available via ssh. In order to avoid inserting the password at each connection, you can set-up an ssh-key which allows you to connect directly, without a password. To accomplish it, follow the steps below.
If you are using windows you should perform these steps with the WSL since some of the bash commands needed are available just on linux.
- Create a ssh key on your laptop if you don't have one:
ssh-keygen -t ed25519 -C "[email protected]"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
- Copy public key to the workstation:
ssh-copy-id -i ~/.ssh/id_ed25519.pub REMOTE_HOST
You can setup a shortcut to connect to each machine by adding the following lines to ~/.ssh/config
:
Host HOSTNAME
HostName IP_ADDRESS
User USERNAME
HOSTNAME
is a name of your choice for each host-user configuration;
IP_ADDRESS
is the IP address of the machine (e.g., 165.234.bla.bla);
USERNAME
is the name of your user on the host machine (e.g., escobar).
# create user with name USERNAME (e.g. paolo)
# GROUP_NAME corresponds to the name of the pc (e.g. ares)
sudo useradd -g GROUP_NAME -G sudo -m -s /bin/bash USERNAME
# set user password in order to be able to access
sudo passwd USERNAME
# remember to change the host in your ssh command with the new username
With main user of the pc (e.g., ares, dodo, zeus) do:
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh
bash ~/miniconda.sh
rm ~/miniconda.sh
sudo chgrp -R GROUP PATH_TO_CONDA
sudo chmod 770 -R PATH_TO_CONDA
On normal user do:
export PATH="PATH_TO_CONDA/bin:$PATH"
exec bash
conda init
exec bash
Due to changes in the path of the conda environments, copy and pasting the old env folder into the new directory does not fully work.
The best solution is to export the old environment into a yaml
file and then creating a new one.
Export and remove the old environment:
conda activate ENV_NAME
conda env export --no-builds > env.yml
conda remove --name ENV_NAME --all
Create the new environment:
conda env create -f env.yml
The following process should be executed on the shared folder which all users should be able to access (e.g. /storage/hdd-1
on ares). Moreover, we need to exec this just one time and then all the files and folders created in the shared directory should be automatically accessible (and writable) by everyone.
Before starting, make sure that acl
is installed by running: sudo apt-get install acl
.
-
Set the
setgid
bit, so that files/folders under will be created with the same group as :chmod g+s <directory> # for example /storage/hdd-1
g+s will ensure that new content in the directory will inherit the group ownership
-
Set the default ACLs for the group and other:
setfacl -R -m g::rwx <directory> # give read, write and execution rights to users inside the group setfacl -R -m o::rx <directory> # give read and execution rights to users outside the group
-
Verify that everything has been set correctly:
getfacl <directory>
Output:
# file: ../<directory>/ # owner: <user> # group: media # flags: -s- user::rwx group::rwx other::r-x default:user::rwx default:group::rwx default:other::r-x