How can you configure a command to automatically execute upon user login in SUSE system?

To set up a command to automatically run after a user logs in to the SUSE system, you can follow these steps:

  1. Open the terminal and log in as the root user.
  2. Open the /etc/profile file for editing using either vi or another text editor.
vi /etc/profile
  1. Add the commands that need to be executed in the file, such as adding the following content to the end of the file.
echo "Welcome to SUSE!" 
  1. Save and close the file.
  2. Restart the system or log out the current user, then log in again to see the set commands automatically executed.

Please note that this method will execute the same command for all users after logging in. If you need to execute different commands for specific users, you can add the corresponding commands in the user’s .bash_profile file.

Leave a Reply 0

Your email address will not be published. Required fields are marked *


广告
Closing in 10 seconds
bannerAds