title: Messed up gitlab permissions and don't know what to do now
body: <p>I tried to get my gitlab-runner to work and with that I messed up my gitlab configuration really bad...I hope it is possible to restore my self-hosted gitlab instance.</p>
  
  <p>First things first: 
  When I run <code>sudo gitlab-ctl status</code> I get the output</p>
  
  <pre><code>down: alertmanager: 1s, normally up, want up; run: log: (pid 8770) 1438s
  down: prometheus: 0s, normally up, want up; run: log: (pid 8742) 1438s
  </code></pre>
  
  <p>The rest of it works as it should I guess. As I said before, the problem related in permission denied error because of messing up the configuration with <code>sudo chown ...</code></p>
  
  <p>Is there a way to restore the old user permissions? Or is there a way to get information about the permissions configuration gitlab needs?</p>
  
  <p>Thank you very much!</p>
  
  <p>PS: When I run <code>sudo gitlab-ctl reconfigure</code> this error appears</p>
  
  <pre><code> ================================================================================
      Error executing action `run` on resource 'execute[/opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-keys check-permissions]'
      ================================================================================
  
      Mixlib::ShellOut::ShellCommandFailed
      ------------------------------------
      Expected process to exit with [0], but received '1'
      ---- Begin output of /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-keys check-permissions ----
      STDOUT: error: could not open /var/opt/gitlab/.ssh/authorized_keys: Permission denied @ rb_sysopen - /var/opt/gitlab/.ssh/authorized_keys
      -rw------- 1 gitlab-redis git 1948 Apr 23 15:33 /var/opt/gitlab/.ssh/authorized_keys
      STDERR: 
      ---- End output of /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-keys check-permissions ----
      Ran /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-keys check-permissions returned 1
  
      Resource Declaration:
      ---------------------
      # In /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/gitlab-shell.rb
  
       85: execute "#{gitlab_shell_keys_check} check-permissions" do
       86:   user git_user
       87:   group git_group
       88: end
       89: 
  
      Compiled Resource:
      ------------------
      # Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/gitlab-shell.rb:85:in `from_file'
  
      execute("/opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-keys check-permissions") do
        action [:run]
        default_guard_interpreter :execute
        command "/opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-keys check-permissions"
        backup 5
        group "git"
        returns 0
        user "git"
        declared_type :execute
        cookbook_name "gitlab"
        recipe_name "gitlab-shell"
        domain nil
      end
  
      System Info:
      ------------
      chef_version=13.6.4
      platform=ubuntu
      platform_version=18.04
      ruby=ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]
      program_name=/opt/gitlab/embedded/bin/chef-client
      executable=/opt/gitlab/embedded/bin/chef-client
  
  
  Running handlers:
  There was an error running gitlab-ctl reconfigure:
  
  execute[/opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-keys check-permissions] (gitlab::gitlab-shell line 85) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
  ---- Begin output of /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-keys check-permissions ----
  STDOUT: error: could not open /var/opt/gitlab/.ssh/authorized_keys: Permission denied @ rb_sysopen - /var/opt/gitlab/.ssh/authorized_keys
  -rw------- 1 gitlab-redis git 1948 Apr 23 15:33 /var/opt/gitlab/.ssh/authorized_keys
  STDERR: 
  ---- End output of /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-keys check-permissions ----
  Ran /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-keys check-permissions returned 1
  </code></pre>