Skip to main content

Posts

Showing posts from August, 2012

sudo Command Tips and Tricks

sing sudo command, an user can execute root only commands. In this article, let us review how to setup sudo environment along with some sudo command examples, tips, and tricks. 1. Set up sudo Environment in /etc/sudoers You can provide sudo privilege to an individual user or a group by modifying /etc/sudoers. sudo access to an user To provide sudo access to an individual user, add the following line to the /etc/sudoers file. sathiya ALL=(ALL) ALL In the above example: sathiya : name of user to be allowed to use sudo ALL : Allow sudo access from any terminal ( any machine ). (ALL) : Allow sudo command to be executed as any user. ALL : Allow all commands to be executed. sudo access to a group To provide sudo access to a group, add the following line to the /etc/sudoers file. %programmers ALL=(ALL) ALL In the above example: programmers : name of group to be allowed to use sudo. Group name should be preceded with percentage symbol. ALL : Allow sudo

Howto: Linux Add User To Group

H ow can I add a user to a group under Linux operating system? You can use the useradd or usermod commands to add a user to a group. The useradd command creates a new user or update default new user information. The usermod command modifies a user account i.e. it is useful to add user to existing group. There are two types of group. First is primary user group and other is secondary group. All user account related information is stored in  /etc/passwd ,  /etc/shadow  and  /etc/group  files to store user information. useradd Example - Add A New User To Secondary Group You need to the useradd command to add new users to existing group (or create a new group and then add user). If group does not exist, create it. The syntax is as follows: useradd -G { group-name }  username In this example, create a new user called vivek and add it to group called developers. First login as a root user (make sure group developers exists), enter: # grep developers /etc/group Output: developer

YUM repository problem

I was trying to install a few packages on a compute node using yum, when I encountered the following problem:- “IOError: <urlopen error unknown url type: media>” Here is how it happened: [root@localhost yum.repos.d]# yum install opensm Loading “rhnplugin” plugin Loading “security” plugin Loading “installonlyn” plugin This system is not registered with RHN. RHN support will be disabled. Setting up Install Process Setting up repositories rhel51                    100% |=========================| 1.3 kB    00:00 Reading repository metadata in from local files primary.xml.gz            100% |=========================| 780 kB    00:00 ################################################## 2857/2857 Parsing package install arguments Resolving Dependencies –> Populating transaction set with selected packages. Please wait. —> Downloading header for opensm to pack into transaction set. media://1192663619.181374%233/opensm-3.0.3-6.el5.x86_64.rpm: [Errno 4] IOE

Ntp Time update

Ntp Time update --------------------------- "yum install ntp" (or is it "yum install ntpd").   In my opinion, if you see the TIME DRIFT messages, feel free to run one of the following commands: sudo /sbin/ntpdate server1.yoga.com