LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   permission denied error (https://www.linuxquestions.org/questions/linux-general-1/permission-denied-error-127656/)

endezeichen 12-20-2003 05:15 PM

permission denied error
 
I'm logged in as root, and still get that error when using simple commands such as 'cd'
Anyone know how to fix this?

trickykid 12-20-2003 05:26 PM

What are you trying to cd into when getting this error? This isn't related to your mounting issue your asking about is it? If it is I would ask you to keep the same discussion in the same thread.

Regards.

endezeichen 12-20-2003 05:42 PM

Im trying to edit my bash_profile to include java. I can't write to the file and was told to use this command along with other things to edit the file through emacs. This isn't the only command that gives me this error. It's happening with almost anything important i'm trying to do and it's getting annoying.

trickykid 12-20-2003 05:59 PM

Why would you need to "cd" into your .bash_profile file? Is this root's .bash_profile file or a users? If its root's, I hope you not just logged in as root all the time, bad security practice.

If your logged in as a user, have you tried editing the file using pico or vi to make your changes? And it should be .bash_profile as well or edit even your .bashrc file in your users home directory.

endezeichen 12-20-2003 06:17 PM

This is the advice I pulled off of another thread which was called "the simple way" to edit read only files. This is one of the things I am trying to do which is giving me the error.

just log in as root in your console (xterm, konsole, what-have-you)
#su
#<password>
cd <dir where file resides>
<your favorite editor> <filename>

make your changes
save your changes

-Example---------------------------
(assuming an open terminal window here)
su
<password>
emacs /etc/modules.conf
<modified lines, added lines, deleted lines what-have-you>
<ctrl><x><ctrl><s>
<ctrl><x><ctrl><c>
-End Example-----------------------

Thanks

trickykid 12-20-2003 06:59 PM

Quote:

Originally posted by endezeichen
This is the advice I pulled off of another thread which was called "the simple way" to edit read only files. This is one of the things I am trying to do which is giving me the error.

just log in as root in your console (xterm, konsole, what-have-you)
#su
#<password>
cd <dir where file resides>
<your favorite editor> <filename>

make your changes
save your changes

-Example---------------------------
(assuming an open terminal window here)
su
<password>
emacs /etc/modules.conf
<modified lines, added lines, deleted lines what-have-you>
<ctrl><x><ctrl><s>
<ctrl><x><ctrl><c>
-End Example-----------------------

Thanks

emacs can be daunting at times. Have you tried using another editor? Like pico, vi or vim?

$ su
$ <password>
# vi /etc/modules.conf
<make changes>
<if using vi or vim, I (eye) is to insert, ESC is to go back to the command so you can type :wq! or Shift ZZ to save your changes. x will delete one character, dd will delete the whole line, and so on.>
# exit
$


All times are GMT -5. The time now is 06:39 PM.