{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/31362","repository_url":"https://api.github.com/repos/saltstack/salt","labels_url":"https://api.github.com/repos/saltstack/salt/issues/31362/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/31362/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/31362/events","html_url":"https://github.com/saltstack/salt/issues/31362","id":134932339,"number":31362,"title":"salt-key returns error when not run as root","user":{"login":"foundatron","id":693916,"avatar_url":"https://avatars.githubusercontent.com/u/693916?v=3","gravatar_id":"","url":"https://api.github.com/users/foundatron","html_url":"https://github.com/foundatron","followers_url":"https://api.github.com/users/foundatron/followers","following_url":"https://api.github.com/users/foundatron/following{/other_user}","gists_url":"https://api.github.com/users/foundatron/gists{/gist_id}","starred_url":"https://api.github.com/users/foundatron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foundatron/subscriptions","organizations_url":"https://api.github.com/users/foundatron/orgs","repos_url":"https://api.github.com/users/foundatron/repos","events_url":"https://api.github.com/users/foundatron/events{/privacy}","received_events_url":"https://api.github.com/users/foundatron/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/saltstack/salt/labels/Bug","name":"Bug","color":"e11d21"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Core","name":"Core","color":"fef2c0"},{"url":"https://api.github.com/repos/saltstack/salt/labels/High%20Severity","name":"High Severity","color":"ff9143"},{"url":"https://api.github.com/repos/saltstack/salt/labels/P2","name":"P2","color":"155fb5"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/13","html_url":"https://github.com/saltstack/salt/milestones/Approved","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/13/labels","id":9265,"number":13,"title":"Approved","description":"All issues that are ready to be worked on, both bugs and features.","creator":{"login":"thatch45","id":507599,"avatar_url":"https://avatars.githubusercontent.com/u/507599?v=3","gravatar_id":"","url":"https://api.github.com/users/thatch45","html_url":"https://github.com/thatch45","followers_url":"https://api.github.com/users/thatch45/followers","following_url":"https://api.github.com/users/thatch45/following{/other_user}","gists_url":"https://api.github.com/users/thatch45/gists{/gist_id}","starred_url":"https://api.github.com/users/thatch45/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thatch45/subscriptions","organizations_url":"https://api.github.com/users/thatch45/orgs","repos_url":"https://api.github.com/users/thatch45/repos","events_url":"https://api.github.com/users/thatch45/events{/privacy}","received_events_url":"https://api.github.com/users/thatch45/received_events","type":"User","site_admin":false},"open_issues":3004,"closed_issues":3493,"state":"open","created_at":"2011-05-14T04:00:56Z","updated_at":"2016-04-07T21:10:30Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2016-02-19T17:57:52Z","updated_at":"2016-04-07T21:42:04Z","closed_at":null,"body":"`salt-key` returns error when not run as root\r\n\r\nI'm attempting to run as salt as unprivileged user described [here](https://docs.saltstack.com/en/latest/ref/configuration/nonroot.html). Regular `salt` commands run without problem, but running `salt-key` commands returns this error:\r\n\r\n```\r\n$ salt-key -L\r\nCRITICAL: Salt configured to run as user \"root\" but unable to switch.\r\n```\r\n\r\nI'm running Centos 7 (using the most recent base Centos AMI on AWS). I experienced this with salt versions 2015.5.8 and 2015.8.7. I initially installed 2015.5.8 using the salt packages in EPEL, and then upgraded to 2015.8.7 using the package in the [repo.saltstack.com](https://docs.saltstack.com/en/latest/topics/installation/rhel.html) after first experiencing the issue.\r\n\r\nI can see that the salt master daemon is running as the correct unprivileged user, and regular `salt` commands seemingly work, so it appears that salt is configured correctly\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/207099184","html_url":"https://github.com/saltstack/salt/issues/31362#issuecomment-207099184","issue_url":"https://api.github.com/repos/saltstack/salt/issues/31362","id":207099184,"user":{"login":"cachedout","id":111616,"avatar_url":"https://avatars.githubusercontent.com/u/111616?v=3","gravatar_id":"","url":"https://api.github.com/users/cachedout","html_url":"https://github.com/cachedout","followers_url":"https://api.github.com/users/cachedout/followers","following_url":"https://api.github.com/users/cachedout/following{/other_user}","gists_url":"https://api.github.com/users/cachedout/gists{/gist_id}","starred_url":"https://api.github.com/users/cachedout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cachedout/subscriptions","organizations_url":"https://api.github.com/users/cachedout/orgs","repos_url":"https://api.github.com/users/cachedout/repos","events_url":"https://api.github.com/users/cachedout/events{/privacy}","received_events_url":"https://api.github.com/users/cachedout/received_events","type":"User","site_admin":false},"created_at":"2016-04-07T21:42:04Z","updated_at":"2016-04-07T21:42:04Z","body":"I can only replicate this without setting that `user: ` argument in the master config file. For me, when that is set correctly salt-key functions as it should. I assume that this user can read that config file?"}}