0

I already know that you can change the command executed for a specific user when he/she logs in. However, I do not know if you can have many start-up programs for the certain user. For example:

oqhax:x:1001:1001:Oqhax,,,:/home/oqhax:/bin/bash

The last section indicates the start-up program. Could you have more than one?

Thank-you

4
  • I am not sure now if you can separate each start-up program with a comma ,
    – Oqhax
    Mar 12 '18 at 18:00
  • Why not just put the commands into your .profile startup script?
    – ErikF
    Mar 13 '18 at 9:35
  • What is that file?
    – Oqhax
    Mar 16 '18 at 17:15
  • It's one of the files automatically read by bash.
    – ErikF
    Mar 16 '18 at 17:48
1

From man 5 passwd:

the program to run at login (if empty, use /bin/sh). If set to a non-existing executable, the user will be unable to login through login(1).

It doesn't say anything about running multiple programs, so no, you cannot put multiple programs there.

If you want to run multiple programs, you could conceivably create a script that runs the various programs, and use the script as the login shell. That said, I don't fully understand what you're trying to accomplish.

1
  • True, we could write all the programs that you want to execute (or commands) in a single one, and then execute that one. Thanks.
    – Oqhax
    Mar 12 '18 at 18:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.