Author Topic: editing /root/.profile  (Read 3525 times)

prokaryx

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • http://
editing /root/.profile
« on: July 24, 2004, 07:51:33 am »
This is a linux question. I'm new to linux.

Why can't I edit the /root/.profile file? As root, I've chmod it to rw but I get an error that the filesystem is read-only when I try to modify it. And yes, the /root directory is also set to rw.

Actually, the main reason I want to edit the .profile file is that I want to customize the bash session (the prompt, environment variables, etc).

Another thing is that /home/zaurus and /home/root have their own .profile files, but after I edited them and rebooted the machine, there wasn't any effect. So what's the purpose of these files?

Stubear

  • Hero Member
  • *****
  • Posts: 1164
    • View Profile
    • http://
editing /root/.profile
« Reply #1 on: July 24, 2004, 09:21:22 am »
If you want the profiles in /home/zaurus and /home/root to be effective you will need to change the shell for root and zaurus to /bin/bash in /etc/passwd (it's currently /bin/sh)

If you want to edit stuff under /root then you will need to remount the root partition rw, make sure you know what you are doing and change it back after you have finished.

To remount root partition rw, mount -o remount,rw /
To remount root partition ro,  mount -o remount,ro /

Stu
SL-C1000, Hand converted to English with Japanese Input
Running X apps via X/Qt
iRiver USB host cable; Diatec P-Cord usb power cable (extendable); Acro's Reel Cable USB (A to A, B, Mini-B,  & Mini-B 8pin); GreenHouse 1Gb PicoDrive+; 2x256Mb Hagiwara SD cards; 128Mb Transcend CF card; 512Mb PQI CF card; AmbiCom WL1100C-CF 11B WLAN card

prokaryx

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • http://
editing /root/.profile
« Reply #2 on: July 27, 2004, 01:22:48 am »
Thanks Stubear! Works like a charm.

gdog

  • Full Member
  • ***
  • Posts: 246
    • View Profile
editing /root/.profile
« Reply #3 on: July 28, 2004, 07:29:33 pm »
Hey Stu,
What's the purpose of remounting / as ro? Just to keep it protected? I'm wondering if I can change the fstab file to have it mounted rw automatically, without disabling the device of course.

Thanks,
gdog
You can tell a lot about a man by the condition of his shoes

Stubear

  • Hero Member
  • *****
  • Posts: 1164
    • View Profile
    • http://
editing /root/.profile
« Reply #4 on: July 28, 2004, 08:24:55 pm »
Quote
Hey Stu,
What's the purpose of remounting / as ro? Just to keep it protected? I'm wondering if I can change the fstab file to have it mounted rw automatically, without disabling the device of course.

Thanks,
gdog
There should be no problem having / mounted rw all the time. I thionk the reason that Sharp did this is to make sure that the / filesystem is protected from the users who don't know what they are doing (read MS users!) deleting or changing stuff that crashes the system.

Also it allows a convenient place to keep all the files that need to be restored when reformating the /home filesystem. You may have already noticed that on a fresh Rom almost all of the files in /home - especially /home/QtPalmtop/ - are sumlinked back to /usr/*.rom/ folders

If you have / rw in this case when you install an app that overwrites an existing link with a file that file will backtrack through the symlink and overwrite the original file in /usr/QtPalmtop.rom.

I did this by mistake with replacing on of the apps that use quicklaunh - the quicklaunch binary was replaced with my freshly installed app and then every app that calls quicklaunch now opens the new app! Had to reflash to fix it. Since that I leave / mounted ro

Stu
SL-C1000, Hand converted to English with Japanese Input
Running X apps via X/Qt
iRiver USB host cable; Diatec P-Cord usb power cable (extendable); Acro's Reel Cable USB (A to A, B, Mini-B,  & Mini-B 8pin); GreenHouse 1Gb PicoDrive+; 2x256Mb Hagiwara SD cards; 128Mb Transcend CF card; 512Mb PQI CF card; AmbiCom WL1100C-CF 11B WLAN card

gdog

  • Full Member
  • ***
  • Posts: 246
    • View Profile
editing /root/.profile
« Reply #5 on: July 28, 2004, 08:51:00 pm »
I haven't had this long enough to get so far as to see what's what. I created a couple of symlinks off / and then remounted it back to ro. I'm a Unix type, but I haven't had the chance to see just how they've laid everything out yet, and I don't want to take the chance of clobbering anything, before I get a better idea of how it's all put together.

I was going to install Perl first, but I think I'm going to try and get vnc up and running first. I've got a lot of editing to do on my menu system since I've found Javascript to be too slow on the Z, and I don't want to go blind or develop carpal tunnel while trying to make wholesale edits to my files

Thanks again Stu,

gdog
You can tell a lot about a man by the condition of his shoes

Stubear

  • Hero Member
  • *****
  • Posts: 1164
    • View Profile
    • http://
editing /root/.profile
« Reply #6 on: July 28, 2004, 09:10:50 pm »
I tried vnc, but found it slow and as I was mostly just editing files with vi I cahnged to just using ssh.

Set it up with private key auth and now I don't even need to type a password to ssh or scp to the Z (I use Keychain to add to add all my keys to ssh-agent at log in)

The layout of the filesystem is a bit confusing - there are a lot of looping symlinks - and Sharp hae put some stuff in weird places (/home/root/lib for example) with symlionks back to their standard location

Stu
SL-C1000, Hand converted to English with Japanese Input
Running X apps via X/Qt
iRiver USB host cable; Diatec P-Cord usb power cable (extendable); Acro's Reel Cable USB (A to A, B, Mini-B,  & Mini-B 8pin); GreenHouse 1Gb PicoDrive+; 2x256Mb Hagiwara SD cards; 128Mb Transcend CF card; 512Mb PQI CF card; AmbiCom WL1100C-CF 11B WLAN card

gdog

  • Full Member
  • ***
  • Posts: 246
    • View Profile
editing /root/.profile
« Reply #7 on: July 29, 2004, 09:47:02 am »
I tried vnc last night too Stu and found it not worth the trouble. So temporarily I'm just using telnet behind my firewall, but I want to investigate ssh today. Are you using Putty on your windows system? How are you initiating a telnet/ssh session to your Z? I've been using CRT for years but don't have the secure version. Come to think of it maybe that's where I should start. CRT is a great product.

gdog
You can tell a lot about a man by the condition of his shoes

Stubear

  • Hero Member
  • *****
  • Posts: 1164
    • View Profile
    • http://
editing /root/.profile
« Reply #8 on: July 29, 2004, 11:29:26 am »
I'm runnning openssh on my Z and linux box (Gentoo) at home and putty with the windows box at work.

I generated ssh2 rsa keys on all my boxes and copied the public keys to the Z /home/zaurus/.ssh/authorized_keys file.

I run Keychain (on Linux) and Pagent (Windows) when I log in to load my public key into ssh-agent so that I don't have to type my pass phrase more than once.

After that I just connect to Z via ssh in xterm - ssh zaurus@192.168.0.201 to open a shell on the Z. Actually I have mapped Z to 192.168.0.201 in my hosts file and set "User Zaurus" for "Host Z" in ~/.ssh/config, so I only have to do "ssh Z" to connect.

I copy files to the Z with "scp <file> Z:/mnt/cf"

Putty is set up with a saved session to zaurus@192.168.0.201 so I can open a terminal by clicking the pagent icon on the taskbar.

Stu
SL-C1000, Hand converted to English with Japanese Input
Running X apps via X/Qt
iRiver USB host cable; Diatec P-Cord usb power cable (extendable); Acro's Reel Cable USB (A to A, B, Mini-B,  & Mini-B 8pin); GreenHouse 1Gb PicoDrive+; 2x256Mb Hagiwara SD cards; 128Mb Transcend CF card; 512Mb PQI CF card; AmbiCom WL1100C-CF 11B WLAN card

gdog

  • Full Member
  • ***
  • Posts: 246
    • View Profile
editing /root/.profile
« Reply #9 on: July 29, 2004, 11:05:52 pm »
I installed Putty on my work laptop today and spend a good part of the afternoon trying to using it to open an ssh connection to my Sun workstation, on which I have openSSH 2.9 running on. I could not get it to work for the life of me. I tried everywhich way to create an rsa key pair. One strange thing about it is that in the generation window the key that showed in the viewer had the normal ssh-rsa header, and the string following the = sign at the end would match my comment (which I found kind of strange), but when I saved it the public key would always be strangely wrapped in comment lines, without the header or "trailer". I tried putting it on my Sun and making it look like my other keys in my authorized_keys2 file, including removing the line wraps, but could not get it to authenticate.

When I would open a putty window it would connect to the box with a prompt of "Login as:". I tried putting my name @my client, but the log would continue to show Key refused. I then tried pageant, but kept getting the same error. I'm new to PuTTy, so any tips you might have would be greatly appreciated.

Thanks,

gdog
« Last Edit: July 29, 2004, 11:06:41 pm by gdog »
You can tell a lot about a man by the condition of his shoes

Stubear

  • Hero Member
  • *****
  • Posts: 1164
    • View Profile
    • http://
editing /root/.profile
« Reply #10 on: July 30, 2004, 06:22:50 am »
The public key file that puttygen saves is strangely formated, I just copied the key from the generation window and saved it in notepad. Copied that file to the Zaurus and cat putty.key >> ~/.ssh/authorized_keys

Stu
SL-C1000, Hand converted to English with Japanese Input
Running X apps via X/Qt
iRiver USB host cable; Diatec P-Cord usb power cable (extendable); Acro's Reel Cable USB (A to A, B, Mini-B,  & Mini-B 8pin); GreenHouse 1Gb PicoDrive+; 2x256Mb Hagiwara SD cards; 128Mb Transcend CF card; 512Mb PQI CF card; AmbiCom WL1100C-CF 11B WLAN card

gdog

  • Full Member
  • ***
  • Posts: 246
    • View Profile
editing /root/.profile
« Reply #11 on: July 30, 2004, 11:36:39 am »
Interesting. On my systems when I ftp the pub key over and paste it into the keys file it has line breaks in it, which I believe SSH2 won't allow. But I think I've tried it every which way, to no avail. I'll spend more time on it today and let you know what happens. Probably user error

Thanks,

gdog
« Last Edit: July 30, 2004, 11:42:53 am by gdog »
You can tell a lot about a man by the condition of his shoes