• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3545
  • Last Modified:

Check all users in the Debian/Linux and there permissions

Hi,

How to check all users in the Debian/Linux and there permissions

I need to know that what user group they belong to

Can anyone please help me

Thanks
0
tia_kamakshi
Asked:
tia_kamakshi
  • 6
  • 5
  • 3
1 Solution
 
fosiul01Commented:
you can check groups for each user by typing : groups username  

or if you go to , cd /etc/ then cat group
it will show you groups name and which user belongs to

now :

what exactly you meant by  : to check all user permission ??

if you want to see permission on /var and bellow direcotry
go to /var then

find -printf "%m\t%P\n" | less

it will give you binary permisison which looks (ugley)
0
 
tia_kamakshiAuthor Commented:
Thanks for  your reply

I executed the command

pbms-pbhi5:/home# cd /etc/ then cat group
pbms-pbhi5:/etc#


basicaly I need to list all  created users and there permissions on Debian/Linux

Many Thanks
0
 
tia_kamakshiAuthor Commented:
Also, I wanted to see list any shares? does linux have shares?

Many thanks for your great help
0
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 
fosiul01Commented:
too many question in one, which is not rule for EE

Also, I wanted to see list any shares? does linux have shares?  : you need to install Samba to share files, do you have Samba install ??

the output :
pbms-pbhi5:/home# cd /etc/ then cat group
pbms-pbhi5:/etc#

it looks like group is empty, which i never seen before

type this : groupadd mygroup

now go to : cat /etc/group

see what you see


about permission :
i have seen some script to check if there is any 777 permisison on the server or not.. or like this

but i realy dont understand how you want to output of your query for seeing all users permission...
0
 
tia_kamakshiAuthor Commented:
Many Thanks

Ok Now onwards I will put it in seperate questions

When I do command

pbms-pbhi5:/etc# cat group

I get long list


pbms-pbhi5:/etc# cat group
root:x:0:pbhadmin1
pbms-pbhi5:/etc# cat group
root:x:0:pbhadmin1
daemon:x:1:
bin:x:2:
sys:x:3:
adm:x:4:
tty:x:5:
disk:x:6:
lp:x:7:
mail:x:8:
news:x:9:
uucp:x:10:
man:x:12:
proxy:x:13:
viernheim:x:1008:abcdmcc
ttttthouse:x:1009:abcdmcc
...
...

So above are the groups you mean

I wanted to list all the created users in this box and what permissions they have

Yes I have samba installed on my system. Now to check the mounts? Please guide

Yes, what does that means

pbms-pbhi5:/etc# cat group
viernheim:x:1008:abcdmcc
ttttthouse:x:1009:abcdmcc
0
 
fosiul01Commented:
Ok look at this line

developer:x:506:user1,user2

here Developer is the group and this developer group has 2 user which is user1 and user2


according to your
viernheim:x:1008:abcdmcc
viernheim = group and it has one usr abcmcc


abotu Samba : if you have define share in sab.conf file then :  smbclient -NL localhost/Sambapchost name

will show you all the share
have a look to this

http://www.melbpc.org.au/pcupdate/2403/2403article7.htm 


about this "I wanted to list all the created users in this box and what permissions they have"
i will have to say my experience in shell script is not that good,
but one thing i can tell , if you want somethign like this output

user1 : Read, write  : filename
user2 : read write  : file2

then ommmm i dont know, it could be done but it wil need good scripting ...

0
 
tia_kamakshiAuthor Commented:
Many Thanks
Right now my hight priority is to get  list all the created users in this box and what permissions they have??
Where is the smbclient located

pbms-pbhi5:~# smb
smbcontrol  smbd        smbpasswd   smbstatus

many thanks for your great help

0
 
Maciej SsysadminCommented:
It's not so easy to list all files/directories for all users and check if they have permission (and if so - what are they) to such files. Or maybe this is quite easy (some shell script to find all files to which each user have read/write/execute permission) but such script can run (depending on how many users and files you have to check) very long. And output can be also very, very long.

To list all your users with all the groups they belong to, you may use below command.

for user in `cat /etc/passwd | cut -d: -f1`; do id $user; done

Open in new window

0
 
Maciej SsysadminCommented:
To find out where is your smbclient binary located run:
updatedb (as root)
locate smbclient

or: find / -name smbclient
0
 
fosiul01Commented:
Where is the smbclient located  : if you install samba and define all the share

then from command prompt if you type

smblicent -L samba-pc-name    [ from remote pc]

or

smbclient -L localhost  [ same pc where samba installed]

it will show you all the share like this , fig 5 , the artile i sent you ..

about permission, as i said, and Oklit confermed aswell, the way you are thinking i dont belived that would be easy to get
0
 
fosiul01Commented:
there is no point of finding smbclient because you dont need to know where its located

its a command which locate normaly /usr/sbin directory

anyway, you neded to learn, how to create samba share on smb.conf file and how to use smbclient command to see those share

have a look this one
http://www.debianadmin.com/file-server-configuration-in-debian-using-samba.html
for all necessary information about samba and smbclient command


0
 
tia_kamakshiAuthor Commented:
Many Thanks for your great help

I will come back to you

Regards
0
 
tia_kamakshiAuthor Commented:
Many Thanks fosiu01 for your great help
Regards
0
 
Maciej SsysadminCommented:
Well... you asked question about your users' permissions, and you accepted answer which is about samba shares (which is another question).
This confuses me a little, as I don't know which answer was solution for you (and I think other users can be confused also).
0

Featured Post

Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

  • 6
  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now