RichW
RichW

Reputation: 10912

Linux folder permissions for multiple users

I have the directory /var/app which I've set to be the home directory for the user 'isapp'. The owner of the folder is 'isapp' and the group is 'isapp'. I'm using Amazon's EC2 service, so when you login to SSH you use the user 'ec2-user'. How can I make it so I can access the contents of that directory via SSH? At the moment I get permission denied with and without sudo.

Upvotes: 3

Views: 14547

Answers (2)

jolivier
jolivier

Reputation: 7635

You can

  • Create a group for the users that should be able to access this folder
  • Add isapp and ec2-user to this group
  • chgrp the /var/app folder to this group
  • chmod the /var/app folder and allow read and execute access for the group chmod g+rx /var/app

The fact that you cannot access this folder with sudo is more strange, sudo cd /var/app is not expected to work but sudo ls /var/app should.

Upvotes: 5

Satish
Satish

Reputation: 17397

usermod -G ec2-user isapp

chmod g+rwx /var/app

Upvotes: 2

Related Questions