0

I try to access .bashrc by typing ~/.bashrc on my terminal. I am connecting to a remote server via ssh. I get an access denied message. I have no problems logging in, just the access denied message for that file. I need to edit it to load a compiler. How do I do that? I have very recently started using Xubuntu and ssh, so I would appreciate an easy to follow answer.

1
  • 1
    What do you see when you type ls -al ~/.bashrc?
    – Aaron
    Feb 7, 2014 at 15:37

2 Answers 2

2

If you want to load environmental variables from .bashrc, you can use

source ~/.bashrc

If for some reason you want to execute it, you have to change permissions first:

chmod u+x ~/.bashrc

After that, you can execute it with

~/.bashrc

However, it doesn't do that much, as it only initializes your shell options.

1

.bashrc is a file, not a command. The syntax ~/.bashrc attempts to run it as a script, which doesn't work. To edit it, you need to first write the name of an appropriate editor - nano is probably a good choice.

Edit the file with nano ~/.bashrc (save and exit with ctrl-x), then disconnect and reconnect to activate the changes.

You must log in to answer this question.

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