centos - sudo ruby picks system ruby but not rvm installed ruby. it doesnt work even after adding user in exempt_group option in sudoers file -
after going through articles understand sudo's environment , commands can use influenced /etc/sudoers
file.
this sudoers
manual - https://www.sudo.ws/man/1.8.13/sudoers.man.html - specifies users in group specified exempt_group option not affected secure_path
alters sudo's path
this how defaults set in /etc/sudoers
file
defaults always_set_home defaults env_reset defaults env_keep = "colors display hostname histsize kdedir ls_colors" defaults env_keep += "mail ps1 ps2 qtdir username lang lc_address lc_ctype" defaults env_keep += "lc_collate lc_identification lc_measurement lc_messages" defaults env_keep += "lc_monetary lc_name lc_numeric lc_paper lc_telephone" defaults env_keep += "lc_time lc_all language linguas _xkb_charset xauthority" # # adding home env_keep may enable user run unrestricted # commands via sudo. # # defaults env_keep += "home" defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin defaults exempt_group=exempt
exempt
group on system user added to.
instead of group
on system, have tried using group
created user_alias
in /etc/sudoers
file. didnt either.
sudo ruby -v
- returns 2.0.0
ruby -v
- returns 2.3.3
how can sudo
pick rvm ruby
without modifying secure_path?
sudo -i
works in case command remote ssh command , dont have access change code triggers command. please help
Comments
Post a Comment