LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-08-2008, 05:23 AM   #1
an_sush
Member
 
Registered: Nov 2008
Posts: 46

Rep: Reputation: 15
Problem adding user to groups


I have problem running the following command:
I installed db2 on RHL5 and the user created was db2inst1 (user group-db2grp1). when i tried to export the db to some location, it failed:
db2 => BACKUP DATABASE TESTDB TO /root WITH 2 BUFFERS BUFFER 1024 PARALLELISM 1 WITHOUT PROMPTING
SQL2061N An attempt to access media "/root" is denied.

On investigating i found that although i m running the command as root, db2 takes db2inst1 as the user and doesnt find appropriate rights on the folder /root
on running the following command, it succeeds:
db2 => BACKUP DATABASE TESTDB TO /home/db2inst1 WITH 2 BUFFERS BUFFER 1024 PARALLELISM 1 WITHOUT PROMPTING
Kindly help. I have added root user in the group db2grp1(which had db2inst1 user) and also given db2inst1 user access to root group.

I guess its a problem with my bash. On running useradd or usermod it throws me error saying command not found. please help

Last edited by an_sush; 12-08-2008 at 05:25 AM.
 
Old 12-08-2008, 06:35 AM   #2
vladmihaisima
Member
 
Registered: Oct 2002
Location: Delft, Netherlands
Distribution: Gentoo
Posts: 196

Rep: Reputation: 33
Each file can has a set on permissions: read(r), execute(x) and write(w).

These permissions can be applied to user, group and all. So you will have a read permission for the user, a write permission for the user and so on.

In a listing (for example when you do "ls -la /") this is encoded in the following way: for each permission just one letter is used if it is available (like rwx if all are available) and a - if it is not available (like ---).

As we have 3 permissions for user, group and all we end up with 9 charachters like: "rwxr-x---" (which means user has all permissions, group doesn't have write and all doesn't have any).

You should check that the directory in which you want to write your backup can be written by user db2inst1. This means one of the following must be true:

- the directory is owned by db2inst1 and the user has write permissions
- the directory's group is one in which the user db2inst1 is found, and the directory has write permissions for the group.
- the directory can be written by anybody.

I wouldn't recommend letting the process doing the backup in /root. If it has a specific home, you can do the backup there and copy it afterwards.

If you really want to do that, you could add db2inst1 to the group that owns /root directory (gpasswd -g db2inst1 group_of_root_dir) and give write permissions to the group (chmod g+w /root). For more info you can check "man gpasswd" and "man chmod".
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
adding multiple groups in a single user guy_ripper Linux - Newbie 1 12-04-2007 10:34 PM
adding user and groups cnm Linux - Enterprise 3 01-03-2007 04:45 AM
Adding user and groups manon Linux - Newbie 3 04-26-2004 01:14 PM


All times are GMT -5. The time now is 11:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration