Tag Info

Hot answers tagged

5

Since you have sudo access, create a sudoers file for yourself, then delete it when the script is done: # grant this user access to the sudo commands without passwords # add all required cmds to the CMDS alias sudo tee /etc/sudoers.d/$USER <<END $USER $(hostname) = NOPASSWD: /usr/bin/apt-get, /usr/sbin/adduser, /bin/rm, ... END # your script goes ...


3

The "echo 300" is executed using sudo, which outputs 300 to stdout in the normal way. Then as your normal user, you are trying to take that output and write to /sys/ Sudo isn't a magic command that elevates privileges for your whole command line. It takes the arguments you passed to it and executes them as a program. Bash (which is running as a normal user) ...


3

The Argonne National Laboratory shut down their public mirror on February 1, 2015. You will need to choose a new mirror. You can do this through several methods. The two most common are: Edit the mirror manually in /etc/apt/sources.list Through System Settings >> Software and Updates >> Download from ... And choose a new mirror from the drop-down list or ...


3

A couple of things to try: Add a line to the following file: /etc/default/grub when you open the line will most likely read: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" change this line to be: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi=off" when you're all done you need to update grub for the change to take effect sudo grub-update I believe the ...


2

Always use visudo to edit sudoers! To fix this, use visudo to remove the last line, ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^` and the duplicate lines preceding it. Defaults !lecture, !tty_tickets, !fqdn Defaults !lecture, !tty_tickets, !fqdn Defaults !lecture, !tty_tickets, !fqdn If it still gives you trouble, comment the only remaining instance ...


2

If your account was created during installation, it will be part of the sudo group, and the sudo group is mentioned in that file (the line with %sudo). You can confirm this by running the groups command, which lists the groups your user is a member of.


2

I do agree that a re-install will be easier and it will have a predicted result (a total recreation of all permissions) but it is possible to do this without a re-install using "acl". On the desktop editions "acl" is installed by default. Now the problem is that because you messed up "sudo" and probably did not create a collection of permissions you will ...


2

Read again: To edit the list of insults, you will need to edit the source and recompile. So get the source and dependencies: apt-get build-dep sudo apt-get source sudo cd sudo* Edit the files. Note that there is no leading slash, since this is a relative path: vim plugins/sudoers/ins_*.h Build: dpkg-buildpackage -us -uc -b Install: sudo dpkg ...


2

The Setuid bit is not set. If it were, the permissions would have an s instead of the first x: $ ls -l /usr/bin/sudo -rwsr-xr-x 1 root root 155008 Feb 11 2014 /usr/bin/sudo Try using pkexec to set it correctly: pkexec chmod a=rx,u+ws /usr/bin/sudo Though I doubt that's the only problem you are going to have.


2

You run here only echo with sudo command, but - his input/output/stderr are from regular user. If you wish to write to file as root user, you can't use > from shell. Instead use for example tee command: echo 300 |sudo tee /sys/block/md0/md/stripe_cache_size


2

Run sudo crontab -e -u root and append the line @reboot /path/to/script to the bottom of the file, then the root user will automagically run your script as root on login. And a friendly reminder to make sure nobody apart from you and root can access the script, otherwise people could run any command as root.


2

You can use the passwd command: # passwd -S root P 11/04/2014 -1 -1 -1 -1 # passwd -l root passwd: password expiry information changed. # passwd -S root L 11/04/2014 -1 -1 -1 -1 # passwd -d root passwd: password expiry information changed. # passwd -S root NP 11/04/2014 -1 -1 -1 -1 From man 1 passwd: -S, --status Display account status ...


2

Nemo already has the functionality to open a folder in a new Window with root permissions. You just have to right-click on a folder icon and select "open as root" in its context menu. Image source: http://2.bp.blogspot.com/-4PwLsyex1Bo/UEqi2kD9h7I/AAAAAAAAANU/iHXfQRKdMfw/s1600/nemo-file-manager-open-as-root.png When you click on that option, you will get ...


2

See the manual for sudo: -k [command] When used alone, the -k (kill) option to sudo invalidates the user's cached credentials. The next time sudo is run a password will be required. So put a sudo -k before every sudo command you want to re-ask for a password. Or behind every command where you want the next commands not to be sudo. By the ...


1

If you type your pw (no * symbols appear - this is default!) and hit enter, it should either accept it or give you a mesage like "That did not work, please try again" and repeat the procedure three times. After that you should be back at your cli prompt. If sudo behaves like I just described, you typed the wrong password. This can have mainly one of the ...


1

It saying that you should install additional packages, so copy and paste this line to the terminal and press Enter: sudo apt-get install libssh2-1 libcurl3 Then icon should work, if it doesn't again open the terminal and type: sense.sh


1

npm ERR! Error: Invalid protocol will show when the proxy is not set to a full absolute URL. You need to do a ... npm config set proxy http://username:password@host:port npm config set https-proxy http://username:password@host:port where username, password, host and port need to be changed to fit your situation.


1

The owner of the svn repository needs to be changed by: sudo chown --recursive camilstaps:plugdev /Path/To/Dir/* The FAT partition needs to be mounted using: UUID=EA08-6773 /media/data vfat gid=1000,uid=1000,dmask=027,fmask=137,nosuid,nodev,users 0 2


1

This script will run on startup. If you really mean this then you are already talking root privileges. What does the rest of your script look like? We can't really judge the security or lack of same from isolated commands. One alternative would be to run it, say, every 5 minutes out of root's crontab. If you are scared of security consequences, you ...


1

Simpler than adding a script to init.d is to write an Upstart configuration. I'd favour this above all. Create a .conf file in /etc/init (say /etc/init/sleep-on-suspend.conf, containing: description "Automatic suspend" start on runlevel [2345] stop on runlevel [016] exec /path/to/script This will be automatically started on reboot. You could even ...


1

If you open that URL in your web browser the page says We regret to inform you that public access to the Argonne software mirror will no longer be available as of February 1, 2015. The service will continue to be available onsite to Argonne employees, but offsite access will require an Argonne VPN connection. You'll need to use another mirror ...


1

One possibility is to look into /etc/passwd by entering grep root /etc/passwd It should show a line starting like root:x: ...... where the x indicates that encrypted passwords are stored in the shadow file. If this is the case, we look into it by running sudo grep root /etc/shadow (shadow file needs sudo to be opened!) You should get a line beginning ...


1

From https://help.ubuntu.com/community/Sudoers: Try adding the following to /etc/sudoers with <username> filled in appropriately: Cmnd_Alias SHUTDOWN_CMDS = /sbin/poweroff, /sbin/halt, /sbin/reboot, /sbin/shutdown <username> ALL=(ALL) NOPASSWD: SHUTDOWN_CMDS


1

Password input is invisible in the terminal for security reasons. I think if you just type your password regardless and press enter it should work?


1

My friend saw my message and helped me fix it by doing: chattr -sia /usr/bin/wget He suggested that I read man chattr to learn more about it. That enabled me to do the chmod.



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