{"action":"created","issue":{"url":"https://api.github.com/repos/ghantoos/lshell/issues/33","repository_url":"https://api.github.com/repos/ghantoos/lshell","labels_url":"https://api.github.com/repos/ghantoos/lshell/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/ghantoos/lshell/issues/33/comments","events_url":"https://api.github.com/repos/ghantoos/lshell/issues/33/events","html_url":"https://github.com/ghantoos/lshell/issues/33","id":10269315,"number":33,"title":"Add a list of user for sudo command","user":{"login":"Seraf","id":393324,"avatar_url":"https://avatars.githubusercontent.com/u/393324?v=3","gravatar_id":"","url":"https://api.github.com/users/Seraf","html_url":"https://github.com/Seraf","followers_url":"https://api.github.com/users/Seraf/followers","following_url":"https://api.github.com/users/Seraf/following{/other_user}","gists_url":"https://api.github.com/users/Seraf/gists{/gist_id}","starred_url":"https://api.github.com/users/Seraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Seraf/subscriptions","organizations_url":"https://api.github.com/users/Seraf/orgs","repos_url":"https://api.github.com/users/Seraf/repos","events_url":"https://api.github.com/users/Seraf/events{/privacy}","received_events_url":"https://api.github.com/users/Seraf/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ghantoos/lshell/labels/wishlist","name":"wishlist","color":"c7def8"}],"state":"closed","locked":false,"assignee":{"login":"ghantoos","id":477561,"avatar_url":"https://avatars.githubusercontent.com/u/477561?v=3","gravatar_id":"","url":"https://api.github.com/users/ghantoos","html_url":"https://github.com/ghantoos","followers_url":"https://api.github.com/users/ghantoos/followers","following_url":"https://api.github.com/users/ghantoos/following{/other_user}","gists_url":"https://api.github.com/users/ghantoos/gists{/gist_id}","starred_url":"https://api.github.com/users/ghantoos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghantoos/subscriptions","organizations_url":"https://api.github.com/users/ghantoos/orgs","repos_url":"https://api.github.com/users/ghantoos/repos","events_url":"https://api.github.com/users/ghantoos/events{/privacy}","received_events_url":"https://api.github.com/users/ghantoos/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2013-01-24T11:30:07Z","updated_at":"2016-02-21T05:48:15Z","closed_at":"2016-02-21T05:48:15Z","body":"Hello,\r\n\r\nIt should be great to have the -u option for sudo and set a user behind it (should be authorized in the config file, in a list).\r\n\r\nIt will allow to authorize this kind of command (for example) :\r\nsudo -u www-data script.php\r\n\r\nI will try to provide a patch soon.\r\nRegards,"},"comment":{"url":"https://api.github.com/repos/ghantoos/lshell/issues/comments/186749690","html_url":"https://github.com/ghantoos/lshell/issues/33#issuecomment-186749690","issue_url":"https://api.github.com/repos/ghantoos/lshell/issues/33","id":186749690,"user":{"login":"ghantoos","id":477561,"avatar_url":"https://avatars.githubusercontent.com/u/477561?v=3","gravatar_id":"","url":"https://api.github.com/users/ghantoos","html_url":"https://github.com/ghantoos","followers_url":"https://api.github.com/users/ghantoos/followers","following_url":"https://api.github.com/users/ghantoos/following{/other_user}","gists_url":"https://api.github.com/users/ghantoos/gists{/gist_id}","starred_url":"https://api.github.com/users/ghantoos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghantoos/subscriptions","organizations_url":"https://api.github.com/users/ghantoos/orgs","repos_url":"https://api.github.com/users/ghantoos/repos","events_url":"https://api.github.com/users/ghantoos/events{/privacy}","received_events_url":"https://api.github.com/users/ghantoos/received_events","type":"User","site_admin":false},"created_at":"2016-02-21T05:48:15Z","updated_at":"2016-02-21T05:48:15Z","body":"The -u flag is already allowed. The security/restrictions behind sudo should be configured in the sudoers configuration file, not in lshell.\r\n\r\nTo use the -u flag, just add the command in sudo_commands:\r\n```sudo_commands: ['whoami'] ```\r\n\r\nThen you will be able to execute it with the -u flag:\r\n```\r\nYou are in a limited shell.\r\nType '?' or 'help' to get the list of allowed commands\r\n~$ sudo -u www-data whoami\r\nwww-data\r\n~$ sudo -u root whoami                                                                                        \r\nroot\r\n```"}}