Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

attaching process of the program to a given custom defined user in Linux

22 views
Skip to first unread message

kushal bhattacharya

unread,
Aug 6, 2017, 4:06:20 AM8/6/17
to
hi,
Is there a way in C ,C++ or by terminal itself ,to attach the process asscociated with the program with a custom defined user?

Marcel Mueller

unread,
Aug 6, 2017, 4:23:50 AM8/6/17
to
On 06.08.17 10.05, kushal bhattacharya wrote:
> hi,
> Is there a way in C ,C++ or by terminal itself ,to attach the process asscociated with the program with a custom defined user?

C++ has no idea of the term 'user'.

But in Linux systems the command 'su' will do the job.
You will need either superuser privilege or the user's password.


Marcel

Jorgen Grahn

unread,
Aug 6, 2017, 3:02:11 PM8/6/17
to
On Sun, 2017-08-06, kushal bhattacharya wrote:
> hi, Is there a way in C ,C++ or by terminal itself ,to attach the
> process asscociated with the program with a custom defined user?

I cannot understand your question; please explain the problem more
clearly. Perhaps it would help to be more concrete.

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .

kushal bhattacharya

unread,
Aug 9, 2017, 5:04:50 AM8/9/17
to
On Sunday, August 6, 2017 at 1:36:20 PM UTC+5:30, kushal bhattacharya wrote:
> hi,
> Is there a way in C ,C++ or by terminal itself ,to attach the process asscociated with the program with a custom defined user?

hi got the solution actually i wanted to name a user say my_user to a program or the process which is started by me and later i can kill that process by that user. As @Marcel Mueller pointed out that it has to be done with the superuser and to be done when launching the executable
0 new messages