Find the answer to your Linux question:
Results 1 to 8 of 8
Hi, I want to create a user 'abc', once the user login, how could I set this user, "forcing him logging out" and "restart the pc"? Could anyone please teach ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2008
    Posts
    4

    user's limitation


    Hi,

    I want to create a user 'abc', once the user login, how could I set this user, "forcing him logging out" and "restart the pc"?

    Could anyone please teach me to do this.


    Thx

  2. #2
    Linux Engineer khafa's Avatar
    Join Date
    Apr 2008
    Location
    Tokyo, Japan
    Posts
    858
    hi

    -to add a user you can use useradd
    Code:
    man useradd
    - to force a user logging out you can track his processes and kill them
    for example(as root you can do as follows)
    Code:
    kill -9 $(ps -U user_login -o "pid=")
    check their man pages with
    Code:
    man kill
    man ps
    - to restart the pc you can use shutdown
    Code:
    man shutdown
    Linux and me it's a love story

  3. #3
    Just Joined!
    Join Date
    Aug 2008
    Posts
    4
    Thank you for your reply, if the user is not as root, how to perform the command as you mentioned.

  4. $spacer_open
    $spacer_close
  5. #4
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,733
    You must have root permissions to add new users.
    oz

  6. #5
    Just Joined!
    Join Date
    Aug 2008
    Posts
    4
    Hi,

    Thanks for your reply, I know how to add the user, but I don't know how to force the user logout and restart the server after login.

    Thx

  7. #6
    Linux Engineer khafa's Avatar
    Join Date
    Apr 2008
    Location
    Tokyo, Japan
    Posts
    858
    Quote Originally Posted by fj8283888 View Post
    Hi,

    Thanks for your reply, I know how to add the user, but I don't know how to force the user logout and restart the server after login.

    Thx
    i gave you the way to do it in my above post
    Linux and me it's a love story

  8. #7
    Just Joined!
    Join Date
    Aug 2008
    Posts
    4
    Quote Originally Posted by khafa View Post
    i gave you the way to do it in my above post
    Thx bros, the quote that you gave, only allowed me to do it under root, how about the user not root?

    Thx

  9. #8
    Linux Engineer khafa's Avatar
    Join Date
    Apr 2008
    Location
    Tokyo, Japan
    Posts
    858
    you cannot kick a user out if you are not root AFAIK.
    Linux and me it's a love story

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •