Tuesday, March 11, 2008

Installing FreeBSD 7.0 - SSH, sudo

Install sshd for remote login
  • Execute: sysinstall
  • Chose configure -> Networking
  • Select sshd
  • Exit installation

Install sudo for gaining root access:
  • Execute: cd /usr/ports/security/sudo
  • Execute: make install clean
  • Execute: visudo

This opens up the dreaded VI. If you don't know how to use VI read this: Installing freebsd 7.0 - Using VI. In the editor you look for a line quite far down in the file. It looks like this:

# %wheel ALL=(ALL) SETENV: ALL

And there is another one that looks like this:


The first one allows any user that belongs to the wheel group to gain root privileges by typing either sudo before any command or execute su to become root.

The second line does the same thing, but requires no password when using the sudo action.

You need to choose whichever option you like the most (I prefer the secure alternative that requires password, even if it is annoying sometimes). Then uncomment that line - that means remove the bracket at the beginning of the line.

You should know enough to get around in VI by now. But I'll take it step by step anyway. Simply stand on the bracket character and press delete when in "the other mode".

Now press the corresponding key for character ":". This gives you a command line at the bottom of the screen. Now write a "w" on the command line and press enter. The file is saved and you can exit with ":" and command "q".


Anonymous said...

thanks for the easy install guide for sudo. it was buggin me that i couldnt find it on google till i clicked ur link :)

Anonymous said...

thanks for sharing this site. various kinds of ebooks are available in this site