sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

0
votes
0answers
4 views

RH software collections enable for command run with sudo

We are using RH software collections for python34 and have the following in /etc/profile.d/scl_enable_python34.sh source scl_source enable rh-python34 This works perfectly for interactive users. ...
0
votes
1answer
19 views

How to delete password for current account

I just installed Ubuntu 15.10 on my new desktop. However, I want to erase the password of it. I followed the instructions here. I now can successfully login with out password, but I cannot use sudo ...
115
votes
4answers
131k views

Why do I need a tty to run sudo if I can sudo without a password?

I have configured sudo to run without a password, but when I try to ssh 'sudo Foo", I still get sudo: sorry, you must have a tty to run sudo. Why does this happen and how can I work around it?
0
votes
2answers
39 views

Why did sudo not work in CentOS? [duplicate]

I am using Centos and want to use sudo command to run as root. But after input the root password, it always prompt to ask me input the password again. I am pretty sure the password is correct since I ...
3
votes
4answers
6k views

Allow paswordless user to change to another passwordless user

I have two users dev and tomcat neither of them have a password. How can I allow dev 1 do su - tomcat without having him having to enter any credentials? 1 connects with ssh keyfile
0
votes
2answers
36 views

Can we install a package through a shell script? [duplicate]

I'm trying to write a shell script so that when I reinstall my Ubuntu again. I could just run script and retain all the packages. And I'm planning to pass password in form of argument. My question ...
0
votes
1answer
52 views

Running .sh Script With Sudo Results In Different Output

I'm seeing some really strange behavior in a script I'm working on.What I have is an svn hook that gets run whenever a commit is made to an svn repo. It runs a sqsh command that generates another ...
1
vote
2answers
24 views

Failed to open config file '/dev/fd/63', error: No such file or directory for wpa_supplicant

When I do this: sudo wpa_supplicant -D nl80211,wext -i wlp4s0 -c <(wpa_passphrase "some ssid" "password") I get Successfully initialized wpa_supplicant Failed to open config file '/dev/fd/63', ...
1
vote
0answers
26 views

Why does visudo compare the contents of `VISUAL` to a fixed whitelist? [duplicate]

This is on Ubuntu 15.10 I'm trying to get a better understanding of visudo and how it works. The documentation explains that visudo will consult the VISUAL environment variable and compare it against ...
1
vote
1answer
22 views

sudo: unable to resolve host “hostname”

I'm testing a VPS provider, and recently created a virtual machine with a hostname testserver using an ubuntu template. This VPS provider reserves and bills resources by the month, so if you create a ...
1
vote
3answers
12k views

sudo: no tty present and no askpass program specified

I have a perl script that I fork from another script that I launch from a web browser via mod_perl. The forked script (which ends up running as apache) needs to sudo service X stop as part of a ...
0
votes
2answers
6k views

apt-get update failed to fetch and /sources.list.d/ empty

Running the sudo apt-get update command, I got the following error: Fetched 988 kB in 16s (59,3 kB/s) W: Failed to fetch ...
-1
votes
0answers
21 views

How to allow sudo user to run commands in different machines [on hold]

In my test lab I have NIS set up in 5 test machines. For example, there are 3 NIS users userA,userB,userC configuring sudo in 1st machine for userA to run commands in 3rd machine as user root . userA ...
2
votes
0answers
245 views

No candidate version found for sudo

When I tried to install sudo in Debian 8.2 via aptitude install sudo I got an error: No candidate version found for sudo. The source list is standart. Here is the Source list: deb ...
4
votes
4answers
572 views

Allow user to run a command with arguments (which contains spaces)

I want to allow one user to run grep (through sudo), and to grep for one specific string in one specific file. I don't want to allow this user to be able to run grep on all files. The user doesn't ...
0
votes
1answer
31 views

what is meant by Defaults:visiblepw in /etc/sudoers file

Im newbie to linux, when i was reading sudo config file, there is a line Defaults visiblepw . i read the definition for the visiblepw in manual page visiblepw By default, sudo will refuse to ...
0
votes
0answers
15 views

kerberos: Why sudo command creates a ticket?

I have successfully set up a kerberos (MIT) / OpenLDAP debian server which can authenticate users with kerberos and get SSH access according to OpenLDAP groups. I must mention that as this is a ...
3
votes
1answer
25 views

How to temporarily change locale for sudo?

To change the locale of the current user like export LANG=en_US.UTF-8. But this environment variable doesn't affect the root user. When I use sudo the display language remains default. How can I ...
3
votes
2answers
36 views

Feedback when entering passwords, without revealing length

I often SSH into a machine and use sudo on it. When entering passwords, I'm always afraid that another window will steal the focus. However, I don't want to display asterisks (with pwfeedback, for ...
1
vote
1answer
46 views

Set sudo umask apart from the user calling it

The problem: I set my umask for my user to be 0077. Now I use sudo instead of su when I need super-user access, and the problem is that whenever I execute a software installation using sudo with ...
2
votes
1answer
860 views

sudo -u git clone

I'm on Ubuntu server 14.04. I am using apache web server which runs as the www-data. I need to do git clone from a script (a web hook). This script will run with www-data user privilages. Running ...
0
votes
3answers
66 views

I want to copy a remote txt file via SSH, but without using root access

I want to copy my hosts to remote /etc/hosts but it doesn't work. I know root SSH access makes things easier, but IMHO root SSH access is a little dangerous. cat /etc/hosts|ssh samba2 "sudo su -c ...
0
votes
5answers
61 views

copy file from user to another in linux

I'm trying to copy a file from my home directory to another user's directory. I have a sudo access for the other user with no password. I tried doing something like: sudo secondUser cp ...
0
votes
1answer
34 views

How can I avoid being prompted for a password in this script? [duplicate]

I’m using Amazon Linux. If I login as my “otheruser” user, and create a script, test.sh, with this text sleep 5 ; sudo reboot now I can login and run the script like so … [davea@mydevbox ~]$ sudo ...
1
vote
2answers
33 views

What does “sudo su -s /bin/bash - <username>” do?

Could someone kind enough explain to me what this command means? sudo su -s /bin/bash - foo I was told that if I want to switch to a different account in this case "foo" without knowing its ...
1
vote
1answer
17 views

Pass Environment Variable to Sudo AWS ec2 sudo node

I am new to linux and AWS. I have a node.js server running on an EC2 instance. I am running the following command to keep it running endlessly and on port 80: $ sudo node app.js & Now when I ...
5
votes
6answers
703 views

What is the threat of a user trying to sudo without permission?

I was sshing into a certain computing system that I use. I was trying to follow some Linux instructions that involved sudo, and tried a few times to enter the password unsuccessfully, before realizing ...
2
votes
1answer
21 views

Exporting a variable so it appears in a script sourced through sudo

I have a bash script/s which has a "main" script which is run as sudo. Variables are declared in this script. Then it sources another commands.sh script, however this script uses sudo to drop back to ...
2
votes
1answer
255 views

Running sudo restricted commands by creating soft link

I have sudo access to one of our test machines and the following are the commands restricted for me: user_sree@sel8585:~> sudo -l user_sree's password: User user_sree may run the following ...
5
votes
2answers
63 views

Why is it safer to give sudo rights to a non root user?

I have recently installed Amazon Linux on EC2 to run NodeJS applications. It is recommended to run them as a non root user. This user will still be me so there is no concern that someone else will ...
1
vote
0answers
24 views

How does shutting down require sudo except when done through a GUI? [duplicate]

If I want to shut down my machine programmatically or on the terminal, I must do sudo poweroff or sudo shutdown. If I want to shut down my machine through my window manager and desktop environment, I ...
1
vote
2answers
45 views

Why when I try to execute a program as normal user I get denied, and when I execute it with sudo I get “Not Found”

In order to execute mysqlbackup I have to execute it as root. Here's the example when I execute it as normal user: mysqlbackup --compress --user=root --socket=/var/lib/mysql/mysql.sock ...
0
votes
1answer
43 views

How can I execute any command as a normal user without sudo?

Is it possible to assign the sticky bit to sudo in order to execute any command as a normal user? Let's suppose that we have the user test and then: test@test$ apt-get update But I don't wanna use ...
3
votes
1answer
74 views

how to: Please sudo, do _not_ setup any environment, especially $SUDO_USER?

I want to start a process as another uid and it should not need any information from $(env), so I strip the environment prior to the sudo -u powerlessuser /bin/processCmd, that is I run this env -i ...
0
votes
0answers
41 views

Authentication required to edit Sudoers - User not listed

I made a small typo in my sudoers file, nothing a simple pkexec can't fix. The problem is that when I added my user with "adduser name" and added "name" to visudo, as well as the root and sudo ...
1
vote
1answer
41 views

how to do administrative commands without sudo?

Is there a possibility to grant administrative privileges to the current logged in user forever? So I don't have to type sudo everytime I want to do something?
0
votes
2answers
30 views

run a sudo command, specifying the password on the same line

I would like to do something like that: sudo -p password rm /a/file Can I put the password and the user on the same line? My Sudo version is 1.8.9p5
0
votes
0answers
20 views

sudo not working on two systems, but runs on remainder of the networked systems

This question is about sudo implementation and I was unable to find a similar question here in the forums. I'm running Redhat 6.6 on my network of 14 servers and 8 workstations. On the primary NIS ...
5
votes
2answers
283 views

How to automaticaly enter sudo's grace period upon login

Knowing that giving a user a sudo's grace period right from the point when he/she login might be a security issue, I still think it will be a beneficial trade-off between security and usability in my ...
6
votes
1answer
4k views

How do I allow non-root users to control a systemd service with instances?

I need to allow users in the dba group to control the database@ services. The answer to this related question is to just list all systemctl "verbs" that I want to allow in the sudoers file, however, ...
0
votes
1answer
48 views

I can't use the “sudo” command on my server [duplicate]

After I edited the /etc/sudoers.d/my_sudoers file with nano I was unable to use sudo. The following errors are giving when trying to use sudo: sudo: parse error in /etc/sudoers.d/my_sudoers near ...
1
vote
1answer
34 views

SOLVED Missing partition / drive Centos 7

I was trying to change permissions on one of my NTFS partitions and I think I have messed something up. I entered the below command on Centos 7 and now the partition is missing from the File Manager. ...
9
votes
1answer
94 views

Possible to check ability to sudo before sudo'ing?

I'm writing a small utility program. I'd like it to attempt to sudo-run something if required. That is: if file permissions don't allow the current user to operate on a particular file (and sudo ...
15
votes
4answers
12k views

sudo cannot open /etc/sudoers

sudo does not work. I have Arch Linux installed on a USB key formatted with BTRFS. Here's the output when I run 'sudo': $ sudo sudo: unable to stat /etc/sudoers: Permission denied sudo: no valid ...
2
votes
3answers
2k views

Why does sudo su work, but su does not? [duplicate]

I have tried this on Fedora and on Ubuntu. kshitiz@kshitiz:~$su su: Authentication failure kshitiz@kshitiz:~$sudo su root@kshitiz:/home/kshitiz# I am entering the same password in both the cases. ...
34
votes
5answers
9k views

How can I `alias sudo !!`?

I'm trying to set an alias for sudo !! in Bash. I tried alias sbb='sudo !!', but it interprets that as a literal !! and prints sudo: !!: command not found If I use double quotes, it substitutes ...
3
votes
4answers
102 views

How to execute multiple commands remotely on few servers?

I am trying to automate these steps so that I don't need to do this on every machines manually. I need to install latest app server software (abc.tar.gz) on all the unix boxes. I need to do this in ...
6
votes
3answers
5k views

Write to a file without redirection?

I am writing a regular compiled application that needs to create a special file and write a magic cookie into it. I can’t write the file directly from the application, the system security model ...
3
votes
3answers
2k views

I accidentally deleted the sudoers file on Mac OS X; is there any way to recover it?

I accidentalley deleted the sudoers file on Mac OS X; is there any way to recover it? And once you've recovered it, how do you set it to mode 0440? I presume not but I am desperate to get it back!
2
votes
4answers
3k views

How to restore to permissions to sudoers file with no password?

The complete story: I launched an Amazon EC2 "Tier" (VPS) running RHEL 7.1 and created a key for ssh. EC2 automaticly crates a user called ec2-user for new Rhel VPSs, and it have the permissions (in ...