0

I am doing work on a remote computer using Secure Shell. I would like to add aliases to the ~/.bashrc file, but only if this edit applies to my user only. So the question, as the title states, is whether the ~/.bashrc file is user specific when I am connected to a remote system using Secure Shell (SSH)?

4
  • 2
    anything in your home folder (~ is a shortcut for /home/your_username, which is your home folder) is specific to the user whose home folder it's in. So it would be specific to anyone who logs in with your username.
    – Esther
    Commented Aug 22, 2022 at 18:20
  • Specific with regard to what user? Remote user, yes (~/.bashrc, from the very pathname, is located in your home folder, so it's user-specific). Local user, no.
    – raj
    Commented Aug 22, 2022 at 18:22
  • Just to be clear, that means that when I edit the ~/.bashrc file my user is the only one who can see that edit, correct?
    – Jacob
    Commented Aug 22, 2022 at 18:25
  • Anybody who has access to the file can see its contents. It depends what access rights you set for that file. But I guess you meant the file is executed when your user logs in. Each user has their own .bashrc file and it executes when that user logs in.
    – raj
    Commented Aug 22, 2022 at 18:53

1 Answer 1

0

As the name implies, ~/.bashrc file is located within ~ directory, that is, user's home directory on the remote machine (~ is a shortcut used for user's home directory and usually is equal to /home/username). So every user has their own separate ~ directory and their own .bashrc file located in that directory. Of course this applies to users on the remote machine. When you login via ssh to the remote machine, the remote machine's OS does not distinguish between local users (ie. users on the machine you are connecting from). All that matters is user on the remote machine.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .