Tag Info

Hot answers tagged

9

Passwords are NOT visible when typed. At the prompt you need to insert your sudo password and then the commandline will come back. There could be some information about the command you issue but in general nothing is shown unless there is an error.


5

If your script runs as "yourUser", you could create a simple file: sudo visudo -f /etc/sudoers.d/myOverrides with this directive: yourUser ALL = NOPASSWD:/usr/bin/apt-get You can find an useful explanation here.


5

Yes, that is how it should be. Ubuntu is designed this way. Benefits of using sudo (from the Community Help Wiki): The Ubuntu installer has fewer questions to ask. Users don't have to remember an extra password (i.e. the root password), which they are likely to forget (or write down so anyone can crack into their account easily). It avoids the "I can do ...


4

sudo does not work the way you envision. You can configure sudo to allow root access to commands, such as gedit, but not specify files. So if you give a user root access to gedit, the user can edit any system file. Example, for the user joe joe ALL = /usr/bin/gedit would grant root access to gedit , but the user could then access and edit any file. ...


4

From what I gather you're simply trying to return to your user account after gaining access to root. Try typing exit in terminal. Or you can simply press CTRL+D.


3

The message is coded into sudo and you can either recompile (I doubt you want to do that) or configure sudo. I HIGHLY SUGGEST you use visudo . visudo checks the syntax of your sudoers file and helps reduce the possibility of breakage due to a typo. See https://help.ubuntu.com/community/Sudoers You add or edit the line(s) Defaults lecture_file = ...


3

You'll need to start by getting root write access to /usr/bin/. You'll need recovery mode or even a Live CD/USB. Both those approaches are covered here — just ignore the password setting bit. By this point you should be logged in as root. Anyway fixing this isn't too hard because most of the files are straight 755 and there are only a handful of ...


2

Wrap it up in a subshell: sudo sh -c "/path/to/script; shutdown -h now" The problem there is the script will run as root too. This might not be an issue (consider it in your case) but you can work around this by using sudo again to break back down to your $USER (which will be replaced because we're using double-quotes): sudo sh -c "sudo -u $USER ...


2

You should add that alias command line to .bashrc file in /root folder and not in /home/user/.bashrc(this .bashrc file belongs to user account not root). By doing so .bashrc file in /root is run at root login, your alias command will be automatically created every time. So that you can use your alias command directly in shell when logged in as root.


2

As mentioned in one of the comments, use apt-get just to download, then dpkg -i to install. mkdir $HOME/.local apt-get download <package_name> dpkg -i --force-not-root --root=$HOME/.local <package_name.deb> Note: what's nice is that apt-get automatically picks the package that fits your Ubuntu distribution and your architecture.


2

I guess the following would work to install the package to a directory: ~/local/ Download the package as package.deb using : apt-get download <package_name> Then run dpkg --install package.deb --instdir=~/local


2

Ok. I have fixed my issue. And like I thought, it was not the file. Solution I had up until 10 minutes ago, only noticed that sudo wasn't working. As most of my work takes place in tmux, I never noticed my user account. Upon first logging in I would get the following error: -bash: /etc/profile Permission denied And it would set me to: I have no ...


2

With the sudoers mechanism you can give specific privilege to a specific user or group. To edit the /etc/sudoers file you need to use visudo. e.g. to give or negate only some specific commands to the user igor you can add the line igor ALL=(ALL) /bin/kill, /usr/bin/, !/usr/bin/apt-get in this example the user igor can execute with sudo all the ...


1

Rahul, first of all you should repair the sudoers file. create a sudoers file on desktop ans paste these lines into it: # # This file MUST be edited with the 'visudo' command as root. # # Please consider adding local content in /etc/sudoers.d/ instead of # directly modifying this file. # # See the man page for details on how to write a sudoers file. # ...


1

Well, your pasted data has all some useful info: COMMAND=/usr/bin/env -u LANGUAGE LC_MESSAGES=C /bin/sh /tmp/tmpBHXhYV/:script: So env was called to execute ~/tmp/tmpBHXhYV/:script:` with sh. If that file is still there, it might help you. It was not called from a TTY, so probably from within another running application.


1

There seems to be more than one issue: 1. Bug #1276348 ssh-agent is missing in backintime-kde in versions <= 1.0.34. Please install this patch with sudo patch /usr/bin/backintime-kde4 < backintime-kde4.diff 2. sudo vs. kdesudo sudo doesn't change $HOME but kdesudo does. $ sudo env | grep ^HOME HOME=/home/germar $ kdesudo env | grep ^HOME ...


1

According to sudoers manual: It is generally not effective to "subtract" commands from ALL using the ’!’ operator. A user can trivially circumvent this by copying the desired command to a different name and then executing that. For example: bill ALL = ALL, !SU, !SHELLS Doesn’t really prevent bill from running the commands ...


1

Make the script executable with: chmod +x ./OculusConfigUtil_i386 Then run it with ./OculusConfigUtil_i386. Both errors result from the missing execute premissions.


1

That guide unfortunately uses pretty quotation marks “” instead of just "". See the difference? So go back, check each file you have edited, and each thing you have copy-pasted and change the pretty quotation marks to "". Oddly enough, it adds a couple of aliases to your .bashrc, which I do not see in this file that you posted (which you call dot.bashrc - is ...


1

If you use NetworkManager, you can try this command to toggle wifi off and on: nmcli radio wifi off nmcli radio wifi on This commands works over D-Bus and is about the equivalent to rfkill block wifi; rfkill unblock wifi.


1

The 'rm' command does not employ the Trashcan mechanism of Unity. You may be able to employ some of the tools mentioned in How to recover deleted files?, however it might already be too late - one of the first steps in a situation like this is "stop using the hard disk"


1

Sudo doesn't behave that way, for security reasons. You can echo the password to sudo using the -s option, but I don't suggest it. Even if you protect your script from other users, they can still see your parameters using e.g. ps -ef. I think your problem is better solved by installing the unattended-upgrades package.


1

Extending time: From the sudo man page : -v When given the -v (validate) option, sudo will update the user's cached credentials, authen‐ ticating the user's password if necessary. For the sudoers plugin, this extends the sudo timeout for another 15 minutes (or whatever ...


1

There's no solution for this bug at this moment because there no root user in ubuntu Linux os, what I'm trying to say is that issues is impossible to solve , 'you need the root access to give permission' , 'ubuntu root access by sudo' , 'sudo is broken' so you can't solve sudo when it doesn't work ,'su' command needs a root user, when you try give 755 ...


1

See the permisions of /etc/shadow file: ls -l /etc/shadow The output is something like: -rw-r----- 1 root shadow 1530 apr 10 08:47 /etc/shadow So, only root and those users from shadow group have permissions to read that file. So, in conclusion, you need to run that command as root. If you think that you run that compound command as root because you ...


1

The problem is that ownership of your file is: user=root group=erelsgl. User root belongs to root group. So to fix your problem: chown root:root <filename> chmod u+s <filename> After that you can remove sudo directive in your script. I tested this on lubuntu 12.04. Another better approach to this kind of problem is configure ...


1

I finally found the solution myself. I simply had to change permissions of the directories /opt and /opt/calibre so that any user can access to them. Now I can execute calibre without root privileges by simply writing calibre and all files and directories generated by calibre are owned by my user.


1

You can look at the schroot package. It provides a way to grant user access to one or more chroots on your system. The configuration allows each chroot to be accessed by only certain users or groups and allows bind-mounting of directories from the host system into each chroot as desired. Once it is configured, it is easy for an ordinary user with no root ...


1

There are many ways you can do this , some easier and some more difficult. Some more secure, some less secure. And then there are all the opinions about all the options. IMO , chroot are the least secure and the most work to maintain. There are scripts and packages to try to lessen the work, but they remain, IMO, the least secure. There is no real way to ...


1

I don't think you've been hacked. I think you've just broken your system so comprehensively that it won't boot. It's hard to say exactly what's happened because while you've said a lot of things, you haven't been very specific with the details. Why would you chown -R anything in /usr/bin? -R is the flag for recursive, it'll aim to change all the files... ...



Only top voted, non community-wiki answers of a minimum length are eligible