Questions tagged [sudo]

The sudo command is a program for Unix and Unix-like computer operating systems that allows a user to run programs with the security privileges of another user (normally the superuser, or root). The name is an abbreviation for "substitute user do" (as in, do a command as if started by another user).

The sudo command is a program for Unix and Unix-like computer operating systems that allows a user to run programs with the security privileges of another user (normally the superuser, or root). The name is an abbreviation for "substitute user do" (as in, do a command as if started by another user).

Unlike the su command, users typically supply their own password to sudo rather than the root password. After authentication, and if the /etc/sudoers configuration file permits the user access, then the system will invoke the requested command.

2818 questions
15
votes
1 answer

create a virtual floppy image without mount?

There are a lot of posts to show to create a virtual floppy image file as a super user or users can run sudo command. The basic steps are: create empty 1.44MB image file by dd command format the image file by mkfs.msdos mount the image file to some…
Congbin Guo
  • 1,685
  • 2
  • 16
  • 16
15
votes
2 answers

Can I gain root permission without leaving vim?

Sometimes when I edit a file which require root permission (e.g. files under /etc), but I forget run vim as sudo. After edit finished, and type :wq to save and leave, I find I can't, even using !wq, because the file is readonly. If I leave and…
Yongqiang Zhou
  • 322
  • 1
  • 12
14
votes
3 answers

Is the "--no-scripts" option enough to account for the security concerns about running composer as root?

I would like to make .sh file for automatic deploy web pages from github to production. I need to run composer install in it but as I run it, it throws me a warning: "Do not run composer install as root super user!" I found out this is because of…
Čamo
  • 3,863
  • 13
  • 62
  • 114
14
votes
1 answer

Preserve sudo environment

I'm trying to execute a script from a different server using ssh Here's the command I'm using from server 1 to launch a query on server 2: ssh -t user@xxx.xxx.xxx.xx "cd /var/www/vhosts/xxxxx/subdomains/preprod/; sudo ./replace.sh"; but the…
Tarek
  • 3,810
  • 3
  • 36
  • 62
14
votes
2 answers

dependency problems - leaving unconfigured

This is what I get when I tried to install git in Ubuntu 18.04. I may have asked a repeated question but I am not getting any solution. kcn@kcn-UBUNTU:~$ sudo apt-get install git Reading package lists... Done Building dependency tree Reading…
Kiran
  • 402
  • 1
  • 4
  • 11
14
votes
4 answers

Mysql works with sudo, but without not. (ubuntu 16.04, mysql 5.7.12-0ubuntu1.1)

I have Ubuntu 16.04, and Mysql 5.7.12-0ubuntu1.1. When I type: sudo mysql -u root I can login into mysql console, but when I type it without sudo: mysql -u root I obtain error: ERROR 1698 (28000): Access denied for user 'root'@'localhost' My…
Daniel
  • 7,684
  • 7
  • 52
  • 76
14
votes
4 answers

Storing sudo password as variable in script - is it safe?

Is storing my password this way safe? echo 'Write sudo password (will not be displayed) and hit enter' read -s password I need it to make commands like this: echo $password | sudo -S apt-get install -y foo bar
Sławosz
  • 11,187
  • 15
  • 73
  • 106
14
votes
3 answers

Why can user vagrant do "sudo su -" without entering password?

I am a new student about vagrant. I just found that I can change to root by "sudo su -" without entering a password when inside the box supervised by Vagrant. Curiously I checked the "/etc/sudoers" and found nothing about user vagrant. Can anyone…
Vincentge
  • 885
  • 2
  • 8
  • 10
14
votes
1 answer

How do I change users in FileZilla?

I am using FileZilla to log in to an SFTP host with my credentials. However, I need to use an equivalent of sudo su - user (as used in linux) to change the user. There are no passwords set for this general user, and hence direct login is not…
user2967948
  • 529
  • 2
  • 8
  • 23
14
votes
5 answers

urllib.request module fails to install in my system

Tried installing urllib.request module using below command sudo pip install urllib.request but it returned Downloading/unpacking urllib.request Could not find any downloads that satisfy the requirement urllib.request Cleaning up... No…
Mounarajan
  • 1,357
  • 5
  • 22
  • 43
14
votes
4 answers

Why is sudo: bundle command not found?

Why is command "bundle" not found when using sudo: [root@desktop gitlab]# sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production sudo: bundle: command not found [root@desktop gitlab]# but does exist when not using sudo: [root@desktop…
user1032531
  • 24,767
  • 68
  • 217
  • 387
14
votes
2 answers

bash run function with different user

Would be possible to run a custom bash function with different priviledges? #!/bin/bash function RunStefano() { while [ 1 ]; do echo "Ciao, ´/usr/bin/whoami´" sleep 10; done & } export -f RunStefano; echo "Welcome,…
Stefano Radaelli
  • 1,088
  • 2
  • 15
  • 35
14
votes
4 answers

Unable to bind to port 80, but running on the current shell works without any issues

I get the following error while trying to run "cap production unicorn:start" F, [2013-07-12T04:36:18.134045 #28998] FATAL -- : error adding listener…
Rpj
  • 5,348
  • 16
  • 62
  • 122
14
votes
1 answer

sudoers is world writable error

I changed the /ect file permissions on Ubuntu 12.10 so that i could edit bash.bashrc so that neo4j can see the JVM but now I am getting errors when i try run the neo4j server I entered the code below and I managed to edit bash.bashrc but now i cant…
Mike Barnes
  • 4,217
  • 18
  • 40
  • 64
14
votes
3 answers

JAVA_HOME not found as Sudo

I have a bash script on a Linux box that runs a Jar file. When logged in as a regular user I don't have permission to run the script, but it prints the following log: *INFO * Using JVM found at /opt/jdk6/bin/java When I try to use the script with…
anotherdave
  • 6,656
  • 4
  • 34
  • 65