Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8983767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:55:21+00:00 2026-06-15T20:55:21+00:00

I am making a text based RPG, and would like to run a bash

  • 0

I am making a text based RPG, and would like to run a bash script upon login of a certain user (The script will basically be lua then once the file is done, logout) but I don’t want the users to access the shell, and I want it to log out as soon as it finishes.

I am at loss as to how to make the script so ctrl+c will not stop it and give users shell access..

I’ve googled, but I must not be using the right phrase…

If anyone could help me, that would be greatly appreciated.

They will be logging in over SSH

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T20:55:22+00:00Added an answer on June 15, 2026 at 8:55 pm

    You could try setting the script as the default shell of the user:

    chsh -s /usr/local/the_script theuser
    

    The script will then be run in place of the default shell and the user will be logged out the moment the script ends.

    You will need to add the script to /etc/shells for it to be accepted as valid login shell.

    Disclaimer: There may be other security implications to this approach, so do take this with a pinch of salt and look further into it before deploying on a production system. For example, you may want to run your script in restricted mode if applicable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a text-based game and I would like my hero to be able
I am currently making this text-based rpg game with a simple GUI. I was
I am making a text-based RPG for a personal project in Java. In the
I'm making a text based RPG to help me learn Java. So I have
I'm new to java and I am making a login program (based on text
I have multiple text based links i would like to connect into the carousel,
Basically I am making a text based game (Not so much a game, more
So I am making a Text-Based RPG Applet in Java. I am using SWING
So yeah, I am making a Text-Based RPG, in the form of an applet.
I'm considering making a text-based RPG-type program in PHP as both a holiday project

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.