In AWS EC2, I am using Centos 7, I observe strange behaviour where a binary for Hashicorp Vault CLI (/usr/local/bin/vault) is available during boot to commands I run in user data. It is also available for users normally. However, if I run sudo -i
it is not available. If I run sudo su - root
, then it is available!
Why would a command be available in user data as root, but not if I try to login as root using sudo -i
?
sudo -i
andsudo su - root
.sudo -i
is instructing sudo to behave as if it's a login,sudo su - root
is instructing su to behave that way. Read the man page for each command to understand the behavior. – yoonix Apr 09 '21 at 07:31/usr/local/bin/vault
? – berndbausch Apr 09 '21 at 07:04