Hot answers tagged

108

You need to add the user hduser to the sudo group (which is the "administrators" group in Ubuntu). If you have already created the user, you can add the user to the sudo group by running the following command in a Terminal: sudo usermod -a -G sudo hduser


64

You are an administrator, but not root. The root user can do anything. Administrators can perform actions as root, but ordinarily what administrators do is not done by root. That way, you have full control over your own system, but only when you choose to use it. Ubuntu asks for your password when you try to do stuff as root, to make sure it's really you. ...


39

The shutdown on the cog-wheel checks if you are allowed to shutdown the machine. This is done via PolicyKit. In case of shutdown this statement in the file /usr/share/polkit-1/actions/org.freedesktop.consolekit.policy is checked: <action id="org.freedesktop.consolekit.system.stop"> <description>Stop the system</description> ...


30

By default adduser adds every new user to a group with the same name as the user's (the group is created if it doesn't already exists). So if you create a user called admin it will be added to the group admin. /etc/sudoers contains the line %admin ALL=(ALL) ALL which means that all members of the group admin are allowed to use sudo - and that's true for ...


29

The simplest way is to use chown: sudo chown -R testuser:testuser /var/www/test/public_html This will make the user & group testuser the owner of the file. or to use chmod: sudo chmod -R 666 /var/www/test/public_html Which will allow read-write permissions for the owner, group, and any other users. Here are manual pages on chown and chmod


23

Ubuntu is a distribution of the GNU/Linux Operationg System which in turn belongs to the Unix system family - a common architecture for a number of modern Operating Systems. Traditionally Unix used to run on mainframe computers. Central computing facilities which serve dozends or hundreds of users via remote terminals. Since all users relied on the ...


21

Normally I'd include instructions in an answer, but this is such a bad idea I'll point you to a couple places to read up on how to do this. You can take it from there. Note that when you break your system you can post here again for help, but people will laugh and shake their heads and make reference to pebkac errors, etc. First, the Ubuntu help page on ...


17

Haven't tried it but this should create a new user and add them to the sudo group, which if your /etc/sudoers is as default, should mean they're allowed to use sudo with their password (just like the standard first user): sudo adduser --group sudo newusername If you've already created the user, you can just run: sudo adduser existing_user sudo man ...


15

Instead you can try, sudo adduser hduser sudo Because In some linux distributions, there is no group called admin in unix. You need to add the user only to the group sudo.


13

When I reboot via the GUI I can do that without my sudo password. Only if you're the only one logged in. If there are any other users (including console users) you may have to enter a root password. This is the same on OS X and newer Windows versions. Why is that? What's happening internally of the ubuntu system there? The following command: ...


11

Because Linux is commonly used as a server or similar, and SSHing into a linux box, even a normal Ubuntu laptop, is quite common. Thing is, you may not want people with SSH access to be able to shut it down, especially when there may be other remotely logged in users using it. Someone with access to the GUI — well, he can shut it down on his own ...


11

The user in question has sudo privileges because it is in the admin group. As wojox commented, you could use visudo and remove sudo privileges from the admin group, but that would remove sudo capabilities from all members of the admin group not just the one user. Alternatively, you can remove the user from the admin group. If screen oriented vi is ...


10

It's improper to say that: "It seems that on Ubuntu, calls to sudo from the GUI are somehow being intercepted by pkexec". pkexec doesn't have to many things in common with sudo. In contrast with sudo, pkexec does not grant root permission to an entire process, but rather allows a finer level of control of centralized system policy. Now, if you want to run a ...


8

This is the intended behavior of vim (and vi). When you edit a readonly file, attempting to write the file the usual way (with :w) fails. This is to prevent you from accidentally changing a readonly file you might not wish to change. If you really want to override the readonly permissions on a file that you own, and write your changes to the file, you must ...


8

Following up on the comments above: Because the admin group doesn't exist on your system we are assuming you are running 12.04. To be able to administer your system with 12.04 you need your user-id to be in the sudo group. I was able to add a user-id to the sudo group as follows. Reboot using grub and select an entry for recovery mode. Select the "root" ...


8

The reason you don't need to be root to initiate a shutdown from the GUI is largely a matter of convenience for the typical desktop user. The system knows that you're the user logged in on the console, so if you shut down the computer by mistake, you can presumably turn it back on. For a user in the shell, you might very well be logged in remotely, so the ...


8

I solved this problem by changing the default policy. There are three ways to achieve this: By giving privilege to a group First create a group mounter by using this command: sudo addgroup mounter Then add the non-admin users to this group. For examle, I'm adding non-admin user normal to this group. sudo adduser normal mounter Then open the policy ...


7

sudo -i runs the shell specified by the password database entry of the target user, which is /bin/false for your system user. Use sudo -u some-daemon-user bash or sudo -u some-daemon-user -H bash if you want to set the $HOME environment variable set for the target user.


7

Search for user accounts in System settings , there you will get window like this Now select the account you want to change to Standard One, Unlock it from the Upper right button which will ask for password. Now selecting the Account type Button ( refer image) , you will get option as Standard. It will again ask for password . Now it is done. For Doing ...


7

Yes, copied from: pbuilder. It is possible to use user-mode-linux by invoking pbuilder-user-mode-linux instead of pbuilder. pbuilder-user-mode-linux doesn't require root privileges, and it uses the copy-on-write (COW) disk access method of User-mode-linux which typically makes it much faster than the traditional pbuilder. User-mode-linux is a somewhat less ...


6

Short answer Simply add your commands at the end of the file /etc/rc.local (but before the exit 0 line!) Long answer Of course there's also the Debian way of doing this - writing a script. Put it in the /etc/init.d/ directory. Lets say you called it FOO. You then run % update-rc.d FOO defaults. You also have to make the file you created, FOO, executable, ...


6

Their are 2 ways to do things with certain pemissions. sudo lets you run commands in your own user account with root privileges. su lets you switch user so that you're actually logged in as root. But this options is default disabled. Read this thread for more information. Use either method only as and when needed, they can cause your system damage if ...


6

You can't! If you wish to give root access to an user, nothing can stop him from do anything he want with the system. Root privileges means no restrictions. So, better, give to an user only the permissions he needs.


6

chown changes file owner and group and not the permission bits. Use sudo chmod 755 /etc/polkit-1/localauthority or with sudo chmod u=rwx,g=rx,o=rx /etc/polkit-1/localauthority But the is absolutely no reason to change the permission. In other words, changing the permissions is a security risk. With your wrong command chown 755 -R ...


5

You don't add a user to the /etc/sudoers file to grant him to use sudo to become root, but you just add him to the sudo and adm groups: sudo adduser USERNAME sudo sudo adduser USERNAME adm This is also what the GUI does when you select "Administrator" as account type.


5

Use gksudo -u root <program_name> or gksudo -k -u root <program_name> to run <program_name> as the root user. See the manpage for the gksudo command for more information.


5

Ahmm.. the problem is that the standard shell of those users is normally set to /bin/false and for security reasons you should not change this. But you can still run for example: sudo -u www-data /bin/sh


5

1) Become root. You can do this using sudo -i or becoming root the old fashioned way su - 2) Run visudo 3) I changed this portion of the sudoers file to have my chosen users become sudo users, and you can add users similarly (blank lines introduce to format cleanly): ## User Aliases ## These aren't often necessary, as you can use regular groups ## (ie, ...


4

In a multi-user system, the last thing you want is your users logging in and being able to randomly reboot the server at any time, thus the command line version of Reboot is a superuser-only command, hence needing you to be root or have sudo rights. Ditto the Halt and PowerOff commands too.


4

I want to keep browsing is incompatible with disable uploading files to internet Here is why: Any website you browse involves two-way traffic: your computer sends data to the website, and the website sends data back to your computer. A user who is "just browsing" a website could type in anything they want. they could, if they wanted, run base64 ...



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