Please explain what all permissions need to be given to do any activities in the Specific user ,
i have already edited in sudo visudo file and and the user below the root .
But still why do we need to use sudo as part of command line in the specific user ,
for example
sudo apt-get update ansible -y is working
but without sudo its not getting installed .
Please let me know what is the solution
Need to understand how we can execute any commands in the specific user other than root, without sudo in the beginning ,
If it is to be used , then why.
apt-get checks the real not effective user ID of the user executing the program. This means it still won’t work for users granted root permissions in the sudoers file - you actually do have to be root, which means sudo
This is because access to a package installer is a security risk. A bad actor could use it to install packages with known security vulnerabilities to open back doors.
Just to complement: As the KK team says, to install the packages with apt you will need always to have root level permission. You can make you user to not need a password when you are using sudo also, but sudo make you have root levels in the operation. There are other ways to install programs like Flatpak and Snaps, which install the software in an isolated environment (Not using the libraries of the system in long story short) . In some cases you can install without sudo like this: flatpak install --user “NameOfTheApp” , I’m not sure if there is an ansible flatkpak version, but I also recommend to install it system wide using apt to avoid config issues and more.
Some programs in Linux like Docker or qemu can make you use the program without using sudo, in many cases you need to edit the /etc/passwd to add your user to the group that the application need. Sometimes this could make a security concern (Docker says that in the documentation for example), but is a way to use some programs without need of sudo.
I think that’s the long story short of “How to use programs in Linux without using root in the process” hope it helps you @shyam.cbse