sudo not working

Asked by Akua Asamoah

I typed in the following command on my Ubuntu Terminal
sudo -
sudo-
su-
su -

In all of the above cases, I got an error saying that the command was not found. When I used the first one before, it worked and moved on to ask for the password. However, after that, it did not work anymore. HOw do I use it correctly?

My other question is about deleting accounts. How do I delete a user account at the command line?

Also, when I used useradd command, I get this error - user cannot lock /etc/passwd

I want to look at my /etc/passwd/ file folder. I went to the filesystem and the etc. folder but could not view either the passwd folder or the shadow folder. i want to see what this looks like. I am working or teaching myself how to use Linux Administration using Virtual PC emulator system for windows on my own home computer.

Also, can you tell me how to change the permissions from the following

I would like to go from - rw-r--r-- to rw-rw-r--.

I typed the following:

chmod rw-rw-r-- file1

I also tried using this
chmod g +w file1

none of this worked for me, am I typing it incorrectly

Thanks

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu sudo Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
mycae (mycae) said :
#1

Can you provide the output of

ls /usr/bin/sudo

?

Revision history for this message
marcus aurelius (adbiz) said :
#2

there's no "-" parameter for sudo. there, however, is a "-u" parameter.

what exactly are you trying to do?

Revision history for this message
marcus aurelius (adbiz) said :
#3

okay. you can check this page for the parameters that might do what you want to do.

http://www.manpagez.com/man/8/sudo/

Revision history for this message
Manfred Hampl (m-hampl) said :
#4

1. The syntax for sudo is
sudo [options] command
when you enter "sudo -" there is no command, so it fails.

2. /etc/passwd is a file, not a folder
you can look at its contents with the command
cat /etc/passwd

3. The chmod syntax for allowing all group members of the group that owns the file to write to this file is
chmod g+w file1
which no space characters between g and + and w

To get usage information most commands have some inbuilt help functionality, usually you can access it with "<command> -h" or "<command> -?" or "<command> --help". You should also look at the manual pages "man <command>", you will find quite a lot of information about the commands and their parameters there. (Note: in the lines before <command> has to be replaced ny the command where you want to know more)

Revision history for this message
Prof. R. Jayaram (rjayaraam) said :
#5

i am not able to login normally
can log in to guest user account only
can not use sudo or su commands
when sudo is used, ir shows unable to change to sudoers gid: Operation not permitted
sudo: setresuid() [0, 0, 0] -> [320, -1, -1]: Operation not permitted
What is the solution ?

Revision history for this message
Manfred Hampl (m-hampl) said :
#6

@Prof Jayaram:
Please do not piggyback on someone else's question, especially if that question is already four years old.
The aim of this question document is helping the original poster, and not some one who puts an additional comment into it.

Please create a question document of your own, and we will be glad to help.

Can you help with this problem?

Provide an answer of your own, or ask Akua Asamoah for more information if necessary.

To post a message you must log in.