Search code examples
linuxauthenticationsshcentosuser-accounts

How to grant access without setup account in CentOS


I have a sudo account (not root) on several CentOS servers. We would like to share the cluster with other uses who do not have an account for research purpose. (By share I mean users can reserve a time slot to use the cluster exclusively.) But setup an account in the OS for each user is too annoying. Is there a good way to grant them authority to read/write/execute their own files during a certain period of time? I am thinking something like temporary username and password that they can use to login through some interface (like a webserver) I offered. And the username and password will expire after when their reservation. Any idea?


Solution

  • You can share your unix user account among several users, by using SSH key authentication.

    In a nutshell, each user generates a public/private key combination. The allowed public keys are then listed in the following file on the shared unix acount:

    $HOME/.ssh/authorized_keys
    

    I'm not aware of a mechanism to control when users are allowed to login. Presumably one could have a cronjob that swaps different versions of the authorized_keys file, dependent on the time of day. (Seems like over engineering the solution, users can easily over-ride this kind of restriction).

    Articles: