install git without admin / sudo or make

I have a MacBook Pro without administrator access or sudo, but I need to git. XCode is not installed, so I do not have access to create, so I can not build from the source. / usr / local is locked, so I can not use MacPorts or Homebrew either.

How can I get a binary git of work?

Can you connect to Ubuntu remotely after restarting sudo from an ssh session?

I have just restarted my workstation from an SSH session. I am not physically near this computer, but I want to connect. Once the workstation rebooted, I was able to reintegrate SSH, but I wonder if I can connect to the workstation from an SSH session.

How can I activate sudo without a password for the apache2 service?

Problem: I do not see how to enable the use of the service apache2 with sudo without password. I can enable it for all user commands, but as this seems like a bad idea, I only want to activate some commands.

Context: I'm trying to configure a streaming distribution / deployment system, and in this context, I let Ansible execute some commands on the target computers. Some of these commands unfortunately require sudo and I have to remove the corresponding password prompt. Ideally, all permissions in this process work with saved keys instead of passwords.

(Machine names have been replaced with placeholder values.)

Machine under Ubuntu 18.04 LTS and Apache 2.x

Machine under Ubuntu 16.04 LTS and Ansible 2.7.8

File /etc/sudoers.d/ansible on machine

ansible ALL = NOPASSWD: / usr / sbin / service / usr / sbin / apache2 *

File / etc / ansible / hostson machine


File ~ / deploy.yml on machine

- hosts: production
remote_user: ansible

- name: stop apache
shell: service apache2 stop
become: yes
become_method: sudo
- name: start apache
shell: service apache2 start
become: yes
become_method: sudo

Additional information:
When running ansible-playbook ~ / deploy.yml sure, I receive an error sudo: a password is required. I can reproduce the prompt for the password when connecting to the target via ssh and then running sudo service apache2 stop and sudo service apache2 start. Therefore, I hesitantly state that the problem lies somewhere with the sudo configuration on and Ansible is only the messenger.

I've tried different configurations of /etc/sudoers.d/ansiblemainly because I am not at all sure of the correct syntax and have tried all kinds of expressions to see what works. The only job I've found is ansible ALL = NOPASSWD: ALL, which I want to avoid for security reasons.

su or sudo – is it really secure?

By default, centos use the root privilege. In some secure environments, we disable root login to ssh and enable sudo.
but when the administrator connects to ssh via the su user, he can update his privilege by entering sudo su and entering his password

So how can it secure the SSH environment and is there a better way to secure it?

Permissions – Can not run the comment sudo, even logged in as sudoers owner (the file / etc / sudoers belongs to the 1321 uid, but must be 0)

I've accidentally changed the owner for / etc ( sudo chown -R john / etc / when logged in as an administrator). I know it's wrong and that it affects / etc / sudoers as well. After that, I'm not able to launch the sudo of admin account and as well as John Account


sudo: / etc / sudoers belongs to uid 1321, should be 0
sudo: no valid sudoers source found, abandon
sudo: unable to initialize the policy plugin

1321 is the uid of John. Get the same error when logged in as John. How to recover sudo to work

Trying to return to the property ( root chown -R / etc / ), error "Operation not allowed"

I use macOS Mojave

command line – sudo telinit 5 & # 39; and "Unable to synchronize the environment to dbus"

I am currently using Kubuntu on my laptop (no Windows partition) and I am trying to learn how to use linux.

At the attempt to kill the GUI, & # 39; sudo telinit 3 & # 39; managed to extinguish it. However, when I used & # 39; sudo telinit 5 & # 39; to restart the GUI, the system went blank and displays a message "Unable to synchronize the environment on dbus". That will not do anything if I click "OK" on the message but will take me back to the Konsole if I press Ctrl + Alt + F6. Then, if I reinsert the command sudo telinit 5, it will take me to a blank page, with a flashing underline bar on it but unable to type anything. The only way to recover the GUI is to restart the laptop.

I am not sure of the reasons for the error message and the possibility of resolving it. Any clarification will be very appreciated.


bash: sudo: apt-get: command not found

I'm new to using Ubuntu and I'm trying to experiment with backup
Everything went well until I tried to install posgresql 9.5 on Ubuntu 18.04 … I used the following command:

sudo apt-get install libedit2 libpeg5 postgresql-client-common zlib1g libgssapi-krb5-2 libldap-2.4-2 libpam0g libxml2 local postgresql-local ssl-cert tzdata sysstat

but it was not installed properly, so I thought about removing and reinstalling and using this:

sudo apt-get remove libedit2 libpeg5 postgresql-client-common zlib1g libgssapi-krb5-2 libldap-2.4-2 libpam0g libxml2 postgresql-local local ssl-cert tzdata sysstat

but something horrible happened: more things were removed than I wanted and I could not use my computer anymore, I did not accept commands like

sudo apt-get

even the networks were formatted and now I can not be online anymore. Does anyone know how to install everything again without using these commands?

linux – output redirection using sudo

I want to execute a command as a user using sudo and redirect the result of this command as a user.
Example, if I run:

touch a file

under the simon user, a file will be owned by the simon user. If I run:

sudo -u ernesto touch a file

then a file belongs to the user ernesto, because I specify that I want to execute the touch command as ernesto. Finally, if I run:

sudo -u ernesto ls / un-folder /> un-file

some-file belongs back to the simon user, because the operator redirects the output of the full command before to a file (which is actually executed by the simon user). I must enter the result of the list of a directory as ernesto, but using sudo, as the directory I want to list, belongs to ernesto, and I can not list the directory with simon.

It must use sudo because the ernesto user allows me to run sudo commands without a password.

I have tried

sudo -u ernesto $ (ls / un-folder /> un-file)
sudo -u ernesto `ls / some-folder /> some-file`
sudo -u ernesto & ls / a-folder /> a-file & # 39;
sudo -u ernesto eval (ls / un-folder /> un-file)
sudo -u ernesto exec (ls / un-folder /> un-file)

hoping it works, but still no luck.

Sudo and Su do not work

trying to change root by using sudo su

Error – sudo is not installed

Trying to go through the command su

error- this program is not installed

What to do, please help

LinuxMint 19.1 indicates the number of characters running sudo commands

I upgraded LinuxMint 19 (Tara) to version 19.1 (Tessa). I noticed running sudo command, the number of characters of the password appears on the screen.

Is not it a security problem?

How can I create a terminal to not display the number of characters?

the number of characters in the sudo password appears