Select Your Language

Infrastructure and Management

Cloud Computing

Storage

Runtimes

Integration and Automation

  • Comments
  • How to "lock" an user in it's login profile.

    Posted on

    Hello,

    We want an user to answer a question while still in it's login profile and then run a command with the answer as part of the argument.

    Whether using csh, bash, or ksh shell the user should be unable to interrupt the profile to drop to the shell.

    Once the command has finished the user will be logged of automatically.

    =======================================

    for bash I think of this solution for the question and logoff in .bashrc

    echo "question?"
    read answer

    command $answer
    exit

    =====================================
    For ksh I guess I can do the same in .profile

    =======================================
    For csh I do not know yet


    Still wondering how to avoid an interrupt, crtl+c to break out of the profile.

    I do not want to use /etc/profile or /etc/bashrc for a batch user is not allowed to run "command", but interactive users must use "command"

    Kind regards,

    Jan Gerrit Kootstra

    by

    points

    Responses

    Red Hat LinkedIn YouTube Facebook X, formerly Twitter

    Quick Links

    Help

    Site Info

    Related Sites

    © 2026 Red Hat