LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   I can't sudo over SSH (https://www.linuxquestions.org/questions/linux-newbie-8/i-cant-sudo-over-ssh-731547/)

SuperDude123 06-08-2009 10:12 PM

I can't sudo over SSH
 
When I do su and type the root password, all works great.

When I log in to the box physically, and open a root terminal, all works great.

When I do

user@DebianServer:~$ sudo nano sudoers

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

[sudo] password for user:
user is not allowed to run sudo on DebianServer. This incident will be reported.

and here's what my sudoers file looks like


# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#

Defaults env_reset

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root ALL=(ALL) ALL
user All=NOPASSWD: ALL

# Uncomment to allow members of group sudo to not need a password
# (Note that later entries override this, so you might need to move
# it further down)
# %sudo ALL=NOPASSWD: ALL



What am I doing wrong?

BTW, this is "Linux version 2.6.26-2-686 (Debian 2.6.26-15lenny3) (dannf@debian.org) (gcc version 4.1.3 20080704 (prerelease) (Debian 4.1.2-25)) #1 SMP Thu May 28 15:39:35 UTC 2009"

jamescondron 06-08-2009 10:23 PM

Don't edit sudoers like that, it even tells you how to edit it.

What happens if you log in as
Code:

ssh root@DebianServer

SuperDude123 06-08-2009 10:24 PM

It works, since I haven't disabled root loging through ssh yet.

jamescondron 06-08-2009 10:27 PM

Well, okay- that means you at least have a back up, and it means ssh isn't affecting anything, its your environment. Do me a favour, capitalise that 'ALL' in sudoers, it may not make a difference; but it can't hurt.

SuperDude123 06-08-2009 10:28 PM

It already is

jamescondron 06-08-2009 10:31 PM

Not in that paste of yours it isn't

SuperDude123 06-08-2009 10:34 PM

Ah, now I see it.

I fixed it and problem solved

thanks


All times are GMT -5. The time now is 09:30 PM.