First, I precise that I was able to ssh on this machine (I think an embedded system based on Debian 7), but I had to set
/ to read-only to prevent any power off problems. I verified that
/var/lock are still writeable, but the
/home folders where I'm not supposed to write anything in normal execution are read-only.
ssh root@ip_address fails with
ssh: connect to host ip_address port 22: Connection refused message.
ssh -v ... tells:
OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: Applying options for * debug2: resolving "192.168.32.30" port 22 debug2: ssh_connect_direct: needpriv 0 debug1: Connecting to 192.168.32.30 [192.168.32.30] port 22. debug1: connect to address 192.168.32.30 port 22: Connection refused ssh: connect to host 192.168.32.30 port 22: Connection refused
Could you please tell me why and how to fix it?
EDIT: Here is how I set my FS to RO:
Original fstab file:
/dev/mmcblk0p2 / auto defaults 1 1 proc /proc proc defaults 0 0 devpts /dev/pts devpts mode=0620,gid=5 0 0 tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0 tmpfs /var/volatile tmpfs defaults 0 0 /dev/mmcblk0p3 /data auto defaults,sync 0 1
Modified fstab file: (I only changed the first line)
/dev/mmcblk0p2 / auto ro 1 1 proc /proc proc defaults 0 0 devpts /dev/pts devpts mode=0620,gid=5 0 0 tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0 tmpfs /var/volatile tmpfs defaults 0 0 /dev/mmcblk0p3 /data auto defaults,sync 0 1
I answered to someone that I can effectively access with ssh if the filesystem is rw.
This is not exactly true. If I boot with option ro in
fstab and then remount
/ in rw, I cannot access with ssh. It works if I change option back to
default and reboot.