Sudo is general way of running something under the root user. The result of env command: ec2-user]# env sbin:/bin:/usr/sbin:/usr/local/bin:/opt/aws/bin When I reopen my shell my $PATH variable is overwritten to this: ec2-user]# echo $PATH We've identified that there is something overwriting my $PATH when i restart my shell The commands are recognized, but if I get root by sudo -i they are still not recognizable, I still get the same error: ~]$ sudo -i -bash: id: command not found -bash: tty: command not found ~]# yum -bash: yum: command not found Linux ip-172-31-33-121 3.14.44-32.39.amzn1.x86_64 #1 SMP Thu Jun 11 20:33: x86_64 x86_64 x86_64 GNU/LinuxĪs mentioned in the answers it was verified that /usr/bin was missing from my $PATH, so I've added it to my $PATH, and now when I get root by sudo su bash: id: command not found -bash: tty: command not ~]# uname -a usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/local/bin:/opt/aws/bin:/root/binīut I'm really new with this server config stuff, I have no idea if this is right. *I tried to restore my path, but I don't know how it was before, so or I restored it and it isn't the problem or I didn't really restored it. I've read somewhere it could be a problem with my PATH, and I remember I did changed something on the PATH variable while doing some installations but I can't remember exactly what and why, I think it was when I was trying to install node.js or npm, anyway I'm not sure how to restore my PATH and if that is really the problem But once I do that all the commands stop working! ec2-user]# yum To become a root user now on my server I have to type sudo su. Now when I type sudo, I get the command instructions (as if I had typed -help) ~]$ sudo Before, when I typed sudo, I would become a root user right away. So I've installed a lot of stuff, moved a lot of stuff around and then I realized that sudo was not behaving normally. I'm not good with command lines or servers.īut I needed to configure for work a AMI of EC2 AWS with LINUX
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |