Place the following in your .cshrc file:
set complete = enhanceAnd finally source the changes:
complete sudo 'n/-l/u/' 'p/1/c/'
% source .cshrcFor more information visit tcsh(1) in the REFERENCE section under complete.
Notes, tips, tutorials, how-tos, etc... All related to Unix-like OS namely FreeBSD and Linux. My way of giving a bit back to the community. ;)
set complete = enhanceAnd finally source the changes:
complete sudo 'n/-l/u/' 'p/1/c/'
% source .cshrcFor more information visit tcsh(1) in the REFERENCE section under complete.
% sudo echo WITHOUT_IPFILTER=yes > /etc/make.confThe key to solve the "problem" was to run the command in a sub-shell to make the redirection work, like so:
root: Permission denied.
% sudo sh -c 'echo WITHOUT_IPFILTER=yes > /etc/make.conf'The answer to this lies in man sudo ;)
%wheel ALL=(ALL) ALLBy enabing this line, users in wheel group will have full root privileges on the computer by providing their password in order to use administrative commands.
%wheel ALL=(ALL) NOPASSWD: ALLsudo can also be used to allow more restrictive usage, for instance to allow the user freebsduser to mount and unmount /cdrom the following line could be added to /usr/local/etc/sudoers:
freebsduser ALL=/sbin/mount /cdrom,/sbin/umount /cdromTo allow members of the users group shutdown the computer add the following to the sudoers file:
%users localhost=/sbin/shutdown -h nowAdd the following line to let user freebsduser access all privileges without entering password:
freebsduser ALL=(ALL) NOPASSWD: ALLAfter editing the sudoers file you'll need to issue a :w! command in visudo as the file is read-only. To use sudo just prefix sudo before the command with specific privileges. For the %wheel ALL=(ALL) ALL example, if you are in the wheel group and want to shutdown the computer you'd type:
# sudo shutdown -h nowAnd insert your passoword.
it won't ask you for a password. After those 5 minutes you must re-authenticate. You can change the timeout value from 5 to another value by setting the password_timeout value in the /usr/local/etc/sudoers file).