Access permission /opt/ in Ubuntu

29,982

The positions about numbers is in this way:

  • first position -> permisions for the Owner (current user)
  • second position -> permisions for the Group (set by owner)
  • third position -> permisions for anyone else

So the numbers means:

0 – no permission, this person cannot read, write or execute
1 – execute only
2 – write only
3 – execute and write only (1 + 2)
4 – read only
5 – execute and read only (1 + 4)
6 – write and read only (2 + 4)
7 – execute, write and read (1 + 2 + 4)

For example:

sudo chmod 755 /opt/ 

Owner -> can execute, write and read
Current user -> can execute and read only
Anyone else -> can execute and read only

Share:
29,982

Related videos on Youtube

Matthew Williams
Author by

Matthew Williams

Updated on September 18, 2022

Comments

  • Matthew Williams
    Matthew Williams over 1 year

    I want to access my /opt/ folder. I have found the following commands for giving access permission.

    I am not sure what is the purpose of this commands, which one is the better to use it to maintain security and access permission both.

    I want to understand the number system within this command.

    sudo chmod 755 -R /opt/

    sudo chmod 755 /opt/

    sudo chmod 775 /opt/

    sudo chmod 777 /opt/

    I didn't know these commands, so what I use to do previously was gksudo nautilius then:

    Right click > change the owner from root to current user group

    Now I have found the chmod command I would like to better understand how this command works and how best to implement it.

    • Nir Alfasi
      Nir Alfasi over 11 years
      did you try man chmod ? or simply google: chmod
    • Admin
      Admin over 11 years
      @alfasin : No i have not ....wait i will try
    • tripleee
      tripleee over 11 years
      These commands are absolutely the wrong solution. The proper solution is to use sudo for the operations which require administrator privileges. If you don't have sudo access, obtain it.
    • Admin
      Admin over 11 years
      @tripleee : I am learning commands as I am going in deeper with ubuntu ..found it amazing to use !!! have started looking in to help documentation of ubuntu... hope i will make it soon