Fun at work!

Posts tagged ‘vi’

How to add a user to sudoers file?

You need root access to add a user to the sudoers file. Enter as root user:

# su -

and put in the root password. Then use this command

# visudo

to make changes on the /etc/sudoers file. It is not recommended to edit the file using text editor.

To add a user, enter the line in appropriate location.

username    ALL=(ALL) ALL

or,

%groupname  ALL=(ALL) ALL
Advertisements

How to jump to a line number in vi?

In command mode, use the following:

123G
or
123gg
or
:123[Enter]
or
123[Enter]

Tag Cloud