Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Creating & Adding User to Database in Linux

Posted on 2007-07-26
7
Medium Priority
?
707 Views
Last Modified: 2012-08-13
1) We have DB2 9 on Linux 8.2.4
2) Our GUI got disabled on reboot once
3) We have given root as installation user and another user for instance creation in db2 and das groups using which we created all databases
4) How to create a normal user in linux & for db2. To which group do we add him to
5) Since Control Center is no longer available how to add this user to database & give him only connect and DML privielges
0
Comment
Question by:k_murli_krishna
  • 4
  • 3
7 Comments
 
LVL 46

Expert Comment

by:Kent Olsen
ID: 19573596
Hi k,

DB2 uses the host for authentication so if you create a unix/linux user you are also creating a Db2 user.

You can add users with the adduser command.  There are all kinds of options to adduser.  The simplest form should be fine:

  adduser -p NewPassword NewUser

or

  adduser --password NewPassword NewUser


DB2 recently announced support for Kerberos and a few other niceties so that it can tie authentication to things like the Microsoft Active Directory, but that's probably not something that you want to do yet.  The installation and setup certainly is not trivial.


Good Luck,
Kent
0
 
LVL 46

Expert Comment

by:Kent Olsen
ID: 19573628
Missed the last question...

Use the GRANT statement to set up the user's permissions

GRANT CONNECT ON database TO USER NewUser;
GRANT CREATEIN ON SCHEMA schema TO USER NewUser;
GRANT ALL PRIVILEGES ON TABLE tablename TO USER NewUser;

Unless you've changed the defaults for the database, your users probably already are given at least this level of authority.


Kent
0
 
LVL 17

Author Comment

by:k_murli_krishna
ID: 19586021
Thanks, kdo. For creating normal user in windows, we just create a user and give 5-6 OS privileges to it. In linux, what is the equivalent of this. Which group do we assign the user into? The default one with its own name, db2grp or the das group? Please advise.
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
LVL 46

Accepted Solution

by:
Kent Olsen earned 300 total points
ID: 19586686

UDB requires three "special" users.  The instance owner, fence user, and the Administration Server user.  All other users are defined and created by the local admins.  No special O/S privileges are required.

That does bring up another point, though.  Any user on the server can be authenticated to connect to DB2.  You'll want to take care on your production servers to explicitly grant privileges to the users that should have access and disallow everyone else.


Kent
0
 
LVL 17

Author Comment

by:k_murli_krishna
ID: 19587112
Thanks, Kent. adduser command that you quoted is for linux. What I would like is a similar command to add user to any db2 database from command line. This is since GUI got disabled on our linux & hence control center is not opening up. This problem I will search to solve or ask in a separate post.
0
 
LVL 17

Author Comment

by:k_murli_krishna
ID: 19588693
useradd is actual linux command. What I mean is in control center we add an user first and then grant connect on database to it. From command line if we just grant connect, will it be added as well?
0
 
LVL 46

Expert Comment

by:Kent Olsen
ID: 19589693

I don't believe so, but I'm not sure.


Kent
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question