On 30-Dec-09 09:52:12, Paul Grenyer wrote:
Hi Ok, I'm feeling really sill now.
I've ... added the user ... to the www-data group. ...
IIRC: sudo usermod g www-data <user>
I'm now wondering if that's taken me out of every group except www-data.
There is a latent 'gotcha' in usermod. From 'man usermod':
"The options which apply to the usermod command are: [...] -a, --append Add the user to the supplemental group(s). Use only with -G option." [...] -G, --groups GROUP1[,GROUP2,...[,GROUPN]]] A list of supplementary groups which the user is also a member of. Each group is separated from the next by a comma, with no intervening whitespace. The groups are subject to the same restrictions as the group given with the -g option. If the user is currently a member of a group which is not listed, the user will be removed from the group. This behaviour can be changed via -a option, which appends user to the current supplementary group list."
So the command to use would be
sudo usermod -a -G www-data <user>
I hit this myself a little while ago, attempting to add myself to an existing group but using a flawed command. I found I had deleted myself from everything else. Fortunately, I had another (dummy) user set up, so I did 'groups dummy' and noted the groups that 'dummy' was in. Then I set about it the right way, and added myself back into the groups I had previously been in ...
However, I cannot guarantee that the above is authoritative. It is based on advice I had found at:
http://www.cyberciti.biz/faq/howto-linux-add-user-to-group
Hoping this helps, Ted. [And welcome to ALUG]
How?
Then I went back and, as recommended, disabled root access via SSH.
How?
I set PermitRootLogin in /etc/ssh/sshd_config to no.
It sounds like your user was previously in group that is allowed to sudo, but is not anymore.
It does. Problem is, as far as I know, this is my only user.
Check your /etc/sudoers file for something like:
# Members of the admin group may gain root privileges %admin ALL=(ALL) ALL
then check that you're in that group, e.g. for my userid "mak":
root@yoda:~# grep ^admin /etc/group admin:x:119:mak
If you get stuck with groups, you can always specifically add a line for your user: "su" to root, then run "visudo" and add a line like:
mak ALL=(ALL) ALL
Thanks, but I don't have permission to do any of that and no idea what the root password might be. I've always just logged in as me and used sudo.
This of course means I can't even shut the machine down remotely. Before I take a monitor and keyboard downstairs to it, is there a way I can get around this (after you've all had a good laugh of course!)?
You can just "su" to root, and then shut down.
Same problem.
Is my system toast? Do I need to start again? :-(
-- Thanks Paul
Paul Grenyer e: paul.grenyer@gmail.com b: paulgrenyer.blogspot.com
main@lists.alug.org.uk http://www.alug.org.uk/ http://lists.alug.org.uk/mailman/listinfo/main Unsubscribe? See message headers or the web site above!
-------------------------------------------------------------------- E-Mail: (Ted Harding) Ted.Harding@manchester.ac.uk Fax-to-email: +44 (0)870 094 0861 Date: 30-Dec-09 Time: 10:42:05 ------------------------------ XFMail ------------------------------