Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
a general question. If iptables manual page (man iptables) shows –uid-owner parameter:
Quote:
–uid-owner { USERNAME } : Matches if the packet was created by a process with the given effective USERNAME
How do i discover this UID?
I tried "id -u debian-tor", it shows an ID. I also tried third string/column from the "grep debian-tor /etc/group" output.
Which one is correct or if none, is there any command that returns the ID?
Or i am totally wrong and the parameter expect debian-tor instead of some number? (even if that is so, it may be interesting for some on how to discover ID behind the username)
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Rep:
Quote:
Originally Posted by postcd
Hello,
a general question. If iptables manual page (man iptables) shows –uid-owner parameter:
How do i discover this UID?
I tried "id -u debian-tor", it shows an ID. I also tried third string/column from the "grep debian-tor /etc/group" output.
Which one is correct or if none, is there any command that returns the ID?
Or i am totally wrong and the parameter expect debian-tor instead of some number? (even if that is so, it may be interesting for some on how to discover ID behind the username)
/etc/passwd for one, the same command you posted, if you're talking about getting a UID for a user.
Hello,
a general question. If iptables manual page (man iptables) shows –uid-owner parameter:
Code:
–uid-owner { USERNAME } : Matches if the packet was created by a process with the given effective USERNAME
How do i discover this UID?
I tried "id -u debian-tor", it shows an ID. I also tried third string/column from the "grep debian-tor /etc/group" output. Which one is correct or if none, is there any command that returns the ID?
Or i am totally wrong and the parameter expect debian-tor instead of some number? (even if that is so, it may be interesting for some on how to discover ID behind the username)
After working with iptables for **SIX YEARS** now, why can you not apply what you've been told/learned to make any progress on your own? It took you longer to log in here and post a question, than it would have taken you to TRY IT, and see what happened and if it worked.
You AGAIN show no effort into looking up a solution, since just putting "linux iptables uid-owner example" into Google pulls up over 96,000 hits, with samples and explanations. VERY FIRST HIT: https://www.linuxjournal.com/article/6091
Samples; examples; explanations, showing how both a match and non-match can be used. Why are you not able to do these things, despite being asked so many times? Or put "how to find UID in linux" into Google?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.