FreeBSD Log: Editing the Sudoers File
May062007 11:51PM — John —This article was updated on May 24th, 2007 to correct superficial errors.
Ok, so you’ve got your FreeBSD installed on your computer, you’ve booted up for the first time and you’re looking at the login: prompt. You’ll need to login as root to configure sudo to allow yourself to run commands as root from your normal account though SSH. So type root at the login: prompt hit enter and then type in your password. Don’t worry that the letters or *s don’t appear for your password, they’re not suppose to. Once you login you should be at the default shell, something like freebsd#, where freebsd is the host you entered during the installation.
Now, from the freebsd# prompt and type visudo and press enter.
freebsd# visudo
You should have the default sudoers file in Vi. Use your arrow keys to move down the page until you see the line root ALL=(ALL) ALL, with your cursor on that line type o, this should create a new line. From there you can type the following line where [yourusername] is the normal user account you setup during the OS installation without the brackets…
[yourusername] ALL = (ALL) ALL
For for example, mine is…
john ALL = (ALL) ALL
From here you press escape then “:” without the quotes, then “x” without the quotes and then hit enter, this will save the file and exit Vi. And now you know why you installed Pico.
This will allow you to run any command as root, as long as you know the root password thus allowing you remotely administer your system completely through SSH. Now you can type exit to logout at the freebsd# prompt and turn off the monitor. From here we will be using SSH.

Leave a comment
Post Info
Filed In:
Solution, Tips & Tricks
Tags:
FreeBSD, FreeBSD Log, Software, UNIX
Permalink:
Related Posts
Free iTunes Song



3 Comments
stupid friggin vi editor i dont know why anyone would design something like that.
Yeah I’m not all that fond of vi neither. I much better prefer to use ee.
Great, but i whant MORE!!