sudo messed UP!
Mitch Contla
mcontla at gmail.com
Sat May 26 20:53:47 UTC 2007
On 5/26/07, Ricardo C O Freitas <ricardo.cofreitas at terra.com.br> wrote:
>
> I was trying to add the user to cups, following cups site info:
>
> with this:
>
> usermod -G lpadmin myuser
>
> The result was a mess!
>
> Many of the services are not allowed to me as user anymore!
>
> When as user I type:
>
> sudo mc
>
usermod can be dangerous. The correct syntax is:
$ sudo usermod -aG lpadmin myuser
The 'a' option appends the user to the group, without it, you make the user
of the specified group and remove membership from all others. The net effect
is that your user account is no longer a member of 'admin'.
For the future, Ubuntu (Debian) provides some 'friendlier' tools for user
administration including 'adduser'. The syntax below is the preferred method
for adding a user to a group:
$ sudo adduser myuser lpadmin
This would have left membership in all other groups.
Also, if you installed the cups package from the Ubuntu repositories, I
think 'myuser' would have automatically been made a member of lpadmin.
As far as the fix goes, if you have another user account that is a member of
admin, login using that account and add 'myuser' back to the appropriate
groups. If you don't have another 'admin' account, you need to either boot
in to single user mode or boot using a live CD (and mount your root file
system), and use a text editor to add 'myuser' to the other groups in
/etc/group. The following list will approximate a list of the groups
'myuser' should belong to (keeping in mind I may have different packages
installed with slightly different groups):
adm
dialout
cdrom
floppy
audio
dip
video
plugdev
users
lpadmin
scanner
myuser
admin
Hope this helps.
--
Mitch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20070526/74c3affa/attachment.html>
More information about the ubuntu-users
mailing list