LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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-24-2010, 01:01 PM   #1
sandhyasharma
LQ Newbie
 
Registered: Dec 2010
Location: Hyderabad
Distribution: CentOS 5
Posts: 3

Rep: Reputation: 0
Smile commands


Hi,

I want to see the users list and the permissions of the users when i logged in a root and how to change the permissions of the users.
2.How to change the permissions for the commands.
example:when i logged with my other user account(not with root user) i dont have a permission to use the move(mv) command.
#mv filename /backup
my error : Permission denied.

I need to know how we can set the permissions for the commands even.

Thanks in advance.Please reply me as soon as possible,even u can reply for this id sandhya.531@gmail.com toooooooo
 
Old 12-24-2010, 01:05 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Nothing at all to do with networking, please pay more attention to the forums you post in. moved to linux newbie.
 
Old 12-24-2010, 01:26 PM   #3
rajasekhar19489
Member
 
Registered: Sep 2010
Location: hyderabad
Distribution: UBUNTU,FEDORA,RHEL5
Posts: 30

Rep: Reputation: 3
Hi,

Quote:
Originally Posted by sandhyasharma View Post
I want to see the users list and the permissions of the users when i logged in a root and how to change the permissions of the users.
Here the only user with all permissions is root . So when u give the command "getent passwd " you get the user details .
And when you give cat "/etc/group" you can see the group root and the groups of users you created . this implies who ever is in the group root as same access as like root, I guess it will not be there in your case. and all other users have no permissions like of root....
correct me if I'm wrong about this And coming to the permissions change thing i guess you can change the permissions availed by a user regarding adminstration stuff by giving him sudo access ( which i dont know exactly how its done) or if u want to give him direct acess then change his group i mean adding the secondary group.


Quote:
Originally Posted by sandhyasharma View Post
2.How to change the permissions for the commands.
example:when i logged with my other user account(not with root user) i dont have a permission to use the move(mv) command.
#mv filename /backup
my error : Permission denied.
This happend becos u performed a operation in the / directory for which user has no access. the only directory users have access is /home/<username> directory . for that directory only he has full permissions


Quote:
Originally Posted by sandhyasharma View Post
I need to know how we can set the permissions for the commands even.
This can be done by copying the commands in /sbin to /bin mostly it will do the trick

for example u take a command xyz when u give the command #whereis xyz you get the locations of all the files related to that xyz. so if it is in /sbin then it can only be executed by root if it is in /usr/sbin it can be accessed by users with sudo access and if it is in /bin then user can execute that ...

and if u talk about permissions there are many more things about it

Hope this clarified your doubt.

regards,
 
Old 12-24-2010, 01:47 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by rajasekhar19489 View Post
Hi,
Here the only user with all permissions is root . So when u give the command "getent passwd " you get the user details .
And when you give cat "/etc/group" you can see the group root and the groups of users you created . this implies who ever is in the group root as same access as like root, I guess it will not be there in your case. and all other users have no permissions like of root....
correct me if I'm wrong about this And coming to the permissions change thing i guess you can change the permissions availed by a user regarding adminstration stuff by giving him sudo access ( which i dont know exactly how its done) or if u want to give him direct acess then change his group i mean adding the secondary group.
Wrong...that command doesn't give you user details...you're getting a list of users, and the same information you can get with "cat /etc/passwd". It doesn't tell you anything about the user permissions.

If you want to change the user permissions, you can add/remove them from groups, which will then have rights/access to different commands/directories, depending on how you set your system up.
Quote:
This happend becos u performed a operation in the / directory for which user has no access. the only directory users have access is /home/<username> directory . for that directory only he has full permissions
Wrong. Users have access to a wide variety of system resources/directories, not just /home/username. That particular user may not have WRITE access to that directory, but may be able to read/execute things just fine. Doing an "ls -l" on a file/directory will tell you who owns it, and what the permissions are.
Quote:
This can be done by copying the commands in /sbin to /bin mostly it will do the trick

for example u take a command xyz when u give the command #whereis xyz you get the locations of all the files related to that xyz. so if it is in /sbin then it can only be executed by root if it is in /usr/sbin it can be accessed by users with sudo access and if it is in /bin then user can execute that ...
This is very, VERY bad advice. First, things are in /sbin for a REASON...copying them elsewhere is a bad idea, and may not make them functional by others..some programs can only be run as root, so copying them elsewhere is pointless. Second, those commands are there because 'regular' users shouldn't be able to run them...you are inviting someone to damage your system, by running things they're not skilled enough to touch. Set users up in sudoers, so you can run root level commands if needed...that's why sudo was invented to start with.
Quote:
and if u talk about permissions there are many more things about it
Hope this clarified your doubt.
regards,
Why didn't you then explain about permissions, and how to check them?? Read the man pages for "ls -l" (check permissions on files/directories), chmod (change permissions), and chown (change ownership).

Also, to rajasekhar19489 and sandhyasharma, spell out your words, and write clearly. That text speak garbage ("becos", "u", etc.) is against LQ rules. And folks are not going to email you answers to your questions....
 
Old 12-24-2010, 02:09 PM   #5
rajasekhar19489
Member
 
Registered: Sep 2010
Location: hyderabad
Distribution: UBUNTU,FEDORA,RHEL5
Posts: 30

Rep: Reputation: 3
Tbone,
Thankyou for pointing my mistakes
Quote:
Originally Posted by TB0ne View Post
Wrong. Users have access to a wide variety of system resources/directories, not just /home/username. That particular user may not have WRITE access to that directory, but may be able to read/execute things just fine. Doing an "ls -l" on a file/directory will tell you who owns it, and what the permissions are.
and for the question about the mv command I was explaining regarding the situation that was explained i know that users also have access to some other directories/files/commands on the system. and sorry for not explaining that.

And I want to know where u can change the sudo access for a user (i want it to be done in CLI mode).


Regarding the first question the user asked i was saying the same thing the passwd file will give you details about the users regarding the groups he belongs to by which you can tell about the users access to the directories/commands/files in the system


Yes I forgot to mention about the man pages.

Really sorry TBONE i was very dumb writing the reply to the question

And i would like to know about giving sudo access to users
 
Old 12-24-2010, 03:16 PM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by rajasekhar19489 View Post
Tbone,
Thankyou for pointing my mistakes and for the question about the mv command I was explaining regarding the situation that was explained i know that users also have access to some other directories/files/commands on the system. and sorry for not explaining that.

And I want to know where u can change the sudo access for a user (i want it to be done in CLI mode).
Again, SPELL OUT YOUR WORDS. And again, check the man pages. "man sudoers" will pull it up, and there are many examples on the web you can easily find via Google, if you tried to look.
Quote:
Regarding the first question the user asked i was saying the same thing the passwd file will give you details about the users regarding the groups he belongs to by which you can tell about the users access to the directories/commands/files in the system
No, you can't. All it will show you is VERY basic user stats. It does not show you the group(s) the user is in, or what rights those groups have.
Quote:
And i would like to know about giving sudo access to users
Great. Read the man pages for sudo/sudoers, or check Google.
 
Old 12-24-2010, 11:19 PM   #7
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Posts: 952

Rep: Reputation: 217Reputation: 217Reputation: 217
Quote:
Also, to rajasekhar19489 and sandhyasharma, spell out your words, and write clearly. That text speak garbage ("becos", "u", etc.) is against LQ rules. And folks are not going to email you answers to your questions....
I thought text speak was one word as in text-speak.

It's obvious that English isn't their mother tongue. They probably think this is normal.

I don't remember sandhya sharma using "that_text-speak garbage" - at least in this thread.

OK

Last edited by AnanthaP; 12-24-2010 at 11:23 PM. Reason: Straight - no pre cog.
 
Old 12-25-2010, 12:45 AM   #8
divyashree
Senior Member
 
Registered: Apr 2007
Location: Bangalore, India
Distribution: RHEL,SuSE,CentOS,Fedora,Ubuntu
Posts: 1,386

Rep: Reputation: 135Reputation: 135
Quote:
Originally Posted by sandhyasharma View Post
Hi,

I want to see the users list and the permissions of the users when i logged in a root and how to change the permissions of the users.
2.How to change the permissions for the commands.
example:when i logged with my other user account(not with root user) i dont have a permission to use the move(mv) command.
#mv filename /backup
my error : Permission denied.

I need to know how we can set the permissions for the commands even.

Thanks in advance.Please reply me as soon as possible,even u can reply for this id sandhya.531@gmail.com toooooooo
BY default root has all permission. A user has permission to run
PHP Code:
mv 
command, but here in your case you maynot have permission to /backup directory. You can check the details of permission of the /backup by
PHP Code:
getfacl /backup 
Then you can get the ownership details of the directory. Here you can see wheather your other user account have permission on this /backup or not. If do not have the permission just add your user account to the group owner or you can separately add permission to /backup with
PHP Code:
setfacl
And the case of commands, you shouldnot change the permission of the comands. If you want to grant some commands can be executed by your other user account you can specify that in
PHP Code:
 /etc/sudoers
And if you want to access all the commands from other user acoount, then add your user account to the group root.

Last edited by divyashree; 12-25-2010 at 12:48 AM.
 
  


Reply



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
Linux equivalent commands for all Solaris commands Harry_Linux008 Linux - Newbie 4 08-22-2010 07:21 PM
what is the similarity between linux commands and dos commands kamalkirat1 Linux - Software 6 11-21-2008 08:54 PM
Need help for Windows cmd commands into Linux terminal commands. windowsNilo Linux - Software 2 07-02-2008 06:26 PM
Need help for Windows cmd commands into Linux terminal commands. windowsNilo Linux - General 2 07-01-2008 06:53 AM
Suse Linux Commands For These Aix Commands? Vaskar Guha Linux - Software 2 12-19-2005 12:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:24 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
Open Source Consulting | Domain Registration