Unable to sudo

Support for security such as Firewalls and securing linux
Post Reply
ben
Posts: 1
Joined: 2015/10/27 16:36:37

Unable to sudo

Post by ben » 2015/10/27 16:39:55

Hello, ive used many linux distros before but ive never used cent OS. when i first logged in i needed to do some commands as root, i also found i couldnt edit /ect at all. When i attempted to use sudo it told me i was not in the sudoers file. various people have suggested using visudo but when i use it it opens a windows which is uneditable. Please help. :(

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: Unable to sudo

Post by aks » 2015/10/27 17:15:51

You need to be root to enable editing of sudo file.
Use su - to become root and then manipulate the sudo file(s)

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Unable to sudo

Post by TrevorH » 2015/10/27 21:06:58

And by default, visudo uses vim so you might want to google "vim cheatsheet" if you are new to vim.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: Unable to sudo

Post by aks » 2015/10/29 17:06:00

You might also need he EDITOR environment variable set to vi as in export EDITOR=$(which vim) - but am not 100% certain.

peterwkc
Posts: 8
Joined: 2015/11/02 12:17:24

Re: Unable to sudo

Post by peterwkc » 2015/11/03 05:08:26

Using su command to become as root user. Thereafter, issue visudo to edit the /etc/sudoers file accordingly.

Post Reply