Click to See Complete Forum and Search --> : .bashrc question


WaveSurfer
06-26-2001, 08:18 AM
I want to make .bashrc read write. From a previous post I was told to use the command.
mount -0 remount,rw /.bashrc
I got an error saying bashrc not in fstab or mtab. So Im assuming this was not the correct way to change the permissions. I need to change .bashrc using vim but cannot save the changes as .bashrc is read only and Im locked out of the shell. I changed it before using a text editor in KDE but made a mistake. So Im doing everything from the command line now.
Thanks in advance.

Strike
06-26-2001, 08:34 AM
Whoa, mount? No no no, you got some bad advice. mount is for filesystems, not files.

Anyway, do ls -l ~/.bashrc and make sure you own the file. For example, mine looks like this:

ddipaolo@half-life:~$ ls -l ~/.bashrc
-rw-r--r-- 1 ddipaolo ddipaolo 503 Jun 26 02:46 /home/ddipaolo/.bashrc

It's owned by user ddipaolo and group ddipaolo (that's me :)). The stuff on the far left says that I have read-write permission on it because I own it and because the second and third letters say "rw". For more info on permissions, type man chmod.

If it doesn't belong to you, su to root, and type:

chown <username> ~/.bashrc

Where <username> is your username, of course. Then (still as root if you want), type:

chmod 644 ~/.bashrc
or
chmod u+rw,a+r ~/.bashrc

That will set read and write permissions for the user that owns the file, and allow every one else read-only access.

WaveSurfer
06-28-2001, 10:00 PM
Thanks for the reply Strike,
Here is the output from the ls command.
[root@localhost/root]# ls -l ~/.bashrc
-rw-r--r-- 1 root root
When I typed in chown the output was:
chown /root/.bashrc : Read only file system.
This is the problem Ive been having all along even as root it wont let me save it or change it. Strange but in KDE I could which is why I have this problem (that Im locked out of KDE)
Thanks

bugfix
06-28-2001, 10:09 PM
Hmmmnnn ... Maybe I'm missing something (I am quite drunk after all) but it seems to me like its not booting to the right run-level on start up and only switches to it when going to X. (Hence read-only issues.)
Mmmmmnnnn .... Odd, most odd. However, I can't quite understand this statement in your reply: "Strange but in KDE I could which is why I have this problem (that Im locked out of KDE)." Do what?

WaveSurfer
06-29-2001, 01:14 AM
Back in the days when I could access KDE I made some adjustments to .bashrc. Everything was Ok until I had some other problems and decided to reinstall Mandrake 8.0. After installing I made the same adjustments but made a few typos and when I tried to reboot I was dropped to shell. I had a look at the file using vim and saw the errors but could not save the corrections. "Read only file" I have tried changing the permissions in root etc etc but keep getting the same read only errors. I dont want to reinstall again as this shouldnt be a hard thing to fix but 2 weeks later and I still cant get it right. All the book s Ive read and all the posters that have advised me say go to root chnage the permissions save the file. But Nothing seems to change it. Now when I was in KDE I could change the file as root unfortunatly I made the typo but I could still change it. So my question is why cant I do it in root from the shell ????

WaveSurfer
06-29-2001, 09:20 PM
OK so Ill reinstall, but this is where Linux is falling down. A simple problem easy to see but a nightmare to fix with no obvious answer. Im using mandrake 8.0 which is supposed to be the easiest to use. Ill stick at it but Im really disapointed.

WaveSurfer
06-29-2001, 09:21 PM
OK so Ill reinstall, but this is where Linux is falling down. A simple problem easy to see but a nightmare to fix with no obvious answer. Im using mandrake 8.0 which is supposed to be the easiest to use. Ill stick at it but Im really disapointed.

fancypiper
06-29-2001, 09:48 PM
Hmmmmm.... It sounds as if the partition that contains /root is mounted as read only as the file permission is right.

Try unmounting and re-mounting the partition, not the file, that contains /root (probably /, check your /etc/fstab if you have forgotten) as read/write, and then change it.

[ 29 June 2001: Message edited by: fancypiper ]

stiles
06-30-2001, 12:37 AM
Originally posted by fancypiper:
[QB]Try unmounting and re-mounting the partition, not the file, that contains /root (probably /, check your /etc/fstab if you have forgotten) as read/write, and then change it.

[QB]

I agree, but you can't umount /. You will have to get your /etc/fstab in order and do an init 6 (reboot).