Tag Info

Hot answers tagged

6

I would have done this like this: #!/bin/bash if [ "$(id -u)" != "0" ]; then echo "This script must be run as root" 1>&2 exit 1 fi Mind that id=0 is what is used inside the kernel to identify the superuser (or root). edit: it will be even better to redirect to STDERR. Here is a one-liner :) (( EUID )) && echo ‘You need to be ...


1

If you're logged as a normal user, say, chris, your desktop will be at /home/chris/Desktop, not /home/desktop. If you're logged in as root (which should be impossible to do with a normal Ubuntu installation), your desktop will be at /root/Desktop.


1

You are right, if you did that, you changed the mode of / of the live-system, but you want to change the mode of / of your root-partition on your hard-disk, so you first need to mount your hard-disk. Assuming your root-partition is /dev/sda2, enter mount /dev/sda2 /mnt to mount your root-partition to /mnt. Then change to that mount-point and change the ...


1

Type: sudo visudo Go to the end of the file and type: <username> ALL=NOPASSWD: ALL Press Ctrl+X to exit, and press Y to save the changes. Now open System Settings->Keyboard in that go to the Shortcut tab. Launch terminal, press Space and Backspace; it will disable it. Now go to Custom Shortcuts and click the plus (+) button at the bottom. ...


1

You need root permissions to do that. Open a terminal and launch Nautilus as root: sudo nautilus or gksu nautilus enter your password and you're good to go. Be carefull because root permissions can screw up your whole system!


1

You should never run a graphical application (such as nautilus) with sudo. You should use gksu instead if you need to do this. Unfortunately, using a graphical application as sudo creates a lot of problems which you are discovering can be difficult to clean up. The technical explanation behind this is that the program you are executing will be executed ...


1

Warning; not tested because I think it's not such a great idea, even for a VM (bad habits are difficult to remove...). I think this is a PAM thing (PAM=pluggable authentication modules). In /etc/pam.d there are all the PAM configuration files that tell the system how to do the authentication of users. Now, the module that check for the passwords "unix ...


1

I have three solution suggestions for you. Invoke the crontab with crontab -e -u root Make sure that you have an empty line at the end of the cronjob file, meaning that every line ends with a newline. You might need to redirect the output to devnull: shutdown -r now > /dev/null Here are two helpful webpages for cronjobs: CRON Tester CRON Generator ...


1

Open a terminal window. By default, you will be in your home directory. cd Desktop ls cat "filename"



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