How to disable sudo without using a sudo command? - terminal

I don't have access to my sudo password anymore, and whenever I try to download anything it always asks for the pass. Is there any way I can either see what my password is or just remove the sudo password altogther?

Related

Provide password to GitHub Actions macOS self-hosted runner

I have set up a CI build server using the GitHub Actions self-hosted runner instructions. Everything works fine until it reaches this instruction:
sudo xcode-select -switch /Applications/Xcode_11.5.app
it asks for my password inside the macOS Terminal. This defeats the purpose of a build server if I have to type in my password every single time this job runs. I've tried configuring the runner as a service but when I did that the job completely failed because it needs a terminal to ask for the password.
Is there a way to set the password so the runner stops asking me every single time?
You can try to remove the sudo command.
The following worked for me by editing the visudo file
do use this with caution as you are making sudo passwordless
Editing visudo
╰─ sudo EDITOR=vi visudo
Commenting the %admin line and adding the following line
╰─ sudo cat /etc/sudoers | grep admin
# %admin ALL = (ALL) ALL
%admin ALL=(ALL) NOPASSWD: ALL
In case you get locked out of sudo, the following will help.
Locked out of sudo ?

Receiving "Unable to start the server: Permission denied" when attempting to manually start safaridriver on macOS

I am attempting to run safardriver from the /usr/bin folder.
If I run the command without sudo, using /usr/bin/safaridriver -p 0, I am still prompted for a password. Entering my password or the admins password does not work.
If i run the command sudo /usr/bin/safaridriver -p 0, I am prompted for a password, and I enter my password, but recieve the error:
Unable to start the server: Permission denied
I have checked the Allow Remote Automation option under the Develop menu in Safari.
Does anyone have any other suggestions on what I might need to do in order to get this to run?
The issue was twofold. I had to restart my machine to get the sudo to work. Once I did that, I also made myself an admin of the machine. This allowed me to run the command without sudo.

Laravel Forge Cannot run sudo command

I'm using "Laravel Forge" and want to run sudo to create swap file, but it's failed because i cannot run sudo command from forge user. how to have root access or run sudo comment ?
When you provisioned your forge server an email was sent to you with the SUDO password. You can su or sudo using this password.
I'm using Amazon lightsail with forge.
I have a pem file provided by lightsail that allows access to the ubuntu user which has sudo without a password.
You can ssh in as ubuntu#<ip address> if you have the pem file.
ssh -i ~/.ssh/xxxxxxxxxxxx.pem ubuntu#xxx.xxx.xxx.xxx

Arch Linux sudo: command not found

I recently installed Arch Linux on my Raspberry Pi and, after logging in as root and creating myself a user account I tried to use the sudo command. This was the result:
[phillipus#alarmpi home]$ sudo mkdir Public
bash: sudo: command not found
After searching for the problem, I logged in as root and executed pacman -S sudo. This was followed by a long output and a confirmation of installation. Following this, I retried to use sudo both as root and as my user, both times getting the same response. Following another solution to the problem, I tried to add myself to /etc/sudoers, only to find out that it didn't exist.
I am not very experienced with Linux, so could you please try to explain your responses fully?
First, you need to install the sudo package to use sudo:
pacman -S sudo
After that, you need to edit the sudoers file and add your username to it.
You can add yor user to the wheel group using usermod -G wheel yourusername and uncomment the %wheel ALL=(ALL) ALLline in the sudoers file. For more information, have a look at Sudo - ArchWiki

sudo access to specific folder

On mac mavericks, i want to install few files without prompting user for sudo password. (Folder where i am trying to install require root access because it is present at / location). I can do this by modifying "sudoer" file and disable sudo password but this is unsafe and open up security risk. Is there any way i can provide sudo access only a particular folder? So when i try to write to this folder, sudo password prompt is not visible to user.
(All above task are done through command line)
Thanks for your help.

Resources