0

I have created multiple users on GCP and all these users can cd into the home directory and do whatever they want. I am using ubuntu lts 20.04 on my VM and was wondering if it is the default. If so, wouldn't be a way to avoid it because every time you use a new VM you will be facing this problem again.

total 28
drwxr-xr-x  6 user1 user1 4096 May 29 05:58 user1
drwxr-xr-x  4 user2        user2        4096 May 23 04:17 user2
drwxr-xr-x 10 user3        user3        4096 May 30 08:43 user3
drwxr-xr-x  4 user4        user4       4096 May 26 07:28 user4
drwxr-xr-x  6 user5        user5      4096 May 30 19:04 user5
drwxr-xr-x  3 ubuntu       ubuntu       4096 May 20 22:10 ubuntu
drwxr-xr-x  4 user6        user6       4096 May 30 18:04 user6
root:x:0:
daemon:x:1:
bin:x:2:
sys:x:3:
adm:x:4:syslog,ubuntu,user3,user2,user5,user6,user1
tty:x:5:syslog
disk:x:6:
lp:x:7:
mail:x:8:
news:x:9:
uucp:x:10:
man:x:12:
proxy:x:13:
kmem:x:15:
dialout:x:20:ubuntu,user3,user2,user5,user6,user1
fax:x:21:
voice:x:22:
cdrom:x:24:ubuntu,user3,user2,user5,user6,user1
floppy:x:25:ubuntu,user3,user2,user5,user6,user1
tape:x:26:
sudo:x:27:ubuntu
audio:x:29:ubuntu,user3,user2,user5,user6,user1
dip:x:30:ubuntu,user3,user2,user5,user6,user1
www-data:x:33:
backup:x:34:
operator:x:37:
list:x:38:
irc:x:39:
src:x:40:
gnats:x:41:
shadow:x:42:
utmp:x:43:
video:x:44:ubuntu,user3,user2,user5,user6,user1
sasl:x:45:
plugdev:x:46:ubuntu,user3,user2,user5,user6,user1
staff:x:50:
games:x:60:
users:x:100:
nogroup:x:65534:
systemd-journal:x:101:
systemd-network:x:102:
systemd-resolve:x:103:
systemd-timesync:x:104:
crontab:x:105:
messagebus:x:106:
input:x:107:
kvm:x:108:
render:x:109:
syslog:x:110:
tss:x:111:
uuidd:x:112:
tcpdump:x:113:
ssh:x:114:
landscape:x:115:
admin:x:116:
netdev:x:117:ubuntu,user3,user2,user5,user6,user1
lxd:x:118:ubuntu,user3,user2,user5,user6,user1
_chrony:x:119:
systemd-coredump:x:999:
ubuntu:x:1000:user3,user2,user5,user6,user1
google-sudoers:x:1001:user3,user2,user5,user6
user3:x:1002:
user2:x:1003:
user5:x:1004:
user6:x:1005:
mysql:x:120:
user4:x:1006:
user1:x:1007:
5
  • The default is group read. That does not mean they can do what they want. Refactor your question into details of your system, which groups the users are part of and specify the home directory permissions. We can then offer answers on how to manage/improve security. Commented May 30, 2022 at 19:44
  • @John Hanley: thank you for helping me to enhance my question. I have added the log of permissions and printed our all the groups. Please let me know if you know more information to help me out.
    – Saeed
    Commented May 30, 2022 at 20:54
  • If you look at the user's directory permissions: drwxr-xr-x, the permissions are anyone can read and list directory contents. To remove those permissions use the chmod command. Example: chmod 750 /home/user2 Google search for documents like this to understand more: docs.rackspace.com/support/how-to/… Commented May 30, 2022 at 20:59
  • @John Hanley: thank you for the reply. I am concerned about launching new VMs later. Should I do it every time that I get a new VM. Isn't there any way to avoid manually changing this?
    – Saeed
    Commented May 30, 2022 at 21:03
  • You will need to set your own security model. This can be automated via the VM's startup script. cloud.google.com/compute/docs/instances/startup-scripts/linux Commented May 30, 2022 at 21:05

0

You must log in to answer this question.

Browse other questions tagged .