Server Access Management Policy
This is the server access management policy that we use for internal staff of the SCC, not for external users who are granted limited access to our instances.
These instructions use grant as the example, but you will need to replace values where needed.
Step 1: Connect to Your EC2 Instance
Open your terminal or command prompt.
Use SSH to connect to your EC2 instance. Replace
your-key.pemwith your private key.ssh -i your-key.pem ubuntu@sp7demofish.specifycloud.org
Alternatively, connect via EC2 Instance Connect if you do not yet have access to the instance.
Step 2: Create a New User
Once connected, create a new user with the appropriate name (e.g.
grant).sudo adduser --disabled-password grant
Follow the prompts to add additional information for the user.
Step 3: Add the User’s Public Key
Create a
.sshdirectory for the new user:sudo mkdir /home/grant/.ssh
Set the correct permissions for the directory:
sudo chmod 700 /home/grant/.ssh
Create an
authorized_keysfile and add the user’s public key. Replaceuser-public-keywith the actual public key.echo "user-public-key" | sudo tee /home/grant/.ssh/authorized_keys
It should look something like:
echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDAWwt7DrPjDtiF4S1G8CRiYrCus5hg6O8bXyK..."Set the correct permissions for the
authorized_keysfile:sudo chmod 600 /home/grant/.ssh/authorized_keys
Change ownership of the
.sshdirectory and its contents to the new user:sudo chown -R grant:grant /home/grant/.ssh
Step 4: Add User to the ubuntu Group
Add the new user
grantto theubuntugroup to ensure they have the same permissions as theubuntuuser:sudo usermod -aG ubuntu grant
Step 6: Verify Permissions
To verify that the permissions are set correctly, you can check the directory permissions:
ls -ld /home/ubuntu
You should see permissions like
drwxrwx---, indicating that the owner and group have full permissions.
Step 7: Test the New User Access
Log out of the current session:
exitHave the new user (e.g.
grant) connect to the EC2 instance using their SSH key:ssh -i user-key.pem grant@sp7demofish.specifycloud.org
Once logged in, the new user should be able to access the
/home/ubuntudirectory and its contents.