Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to use this command to allow me passwordless login to a FreeNAS box:

cat ~/.ssh/id_rsa.pub | ssh root@server.com 'cat >> ~/.ssh/authorized_keys'

But I get:

/root/.ssh/authorized_keys: Read-only file system.

If I log in to box as root, then ls ~/.ssh I see

drwx------  2 root  wheel   512 Aug 22 18:34 ./
drwxr-xr-x  3 root  wheel   512 Sep  1 19:16 ../
-rw-r--r--  1 root  wheel   806 Aug 22 18:39 authorized_keys
-rw-------  1 root  wheel  1675 Aug 18 21:50 id_rsa
-rw-r--r--  1 root  wheel   400 Aug 22 18:34 known_hosts

And if I ls ~ I see

drwx------   2 root  wheel   512 Aug 22 18:34 .ssh/

What am I missing? Why can't I add an entry to known_hosts?

share|improve this question
    
I guess your device's filesystem is read-only, just like the error says. What type of filesystem is it? What's the underlying device (likely an mtdblock device)? –  Celada Feb 6 '13 at 2:01
    
As a side-note, I'd recommend using ssh-copy-id to copy the key if possible. –  Cristian Ciupitu Jun 15 at 4:01
add comment

2 Answers

Login to your FreeNas Machine and open the Terminal enter:

mount -o rw /

when done enter

mount -o ro /
share|improve this answer
add comment

You have to enable "root" login from the FreeNAS GUI if you want to use the "root" user over ssh. (which in the ssh best practice config, is DON'T DO IT). I use my user to ssh in to the FreeNAS and Then "su" up to the root user. Or you can allow your user sudo access.

http://doc.freenas.org/index.php/SSH & http://doc.freenas.org/index.php/Users

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.