edit sshd_config from freebsd8_rescue
Lowell Gilbert
freebsd-questions-local at be-well.ilk.org
Mon Jun 29 14:28:36 UTC 2015
Norman Khine <norman at khine.net> writes:
> Hello,
> I have a server running FreebSD8 from OVH, this had a problem, and I had to
> restart it in rescue mode.
>
> This is what I did so far:
>
> rescue-bsd# df -aTh
> Filesystem Type Size Used Avail
> Capacity Mounted on
> XX.XX.XX.XX:/home/pub/bsd-rescue8_64 nfs 1.9T 223G 1.6T 12% /
> devfs devfs 1.0k 1.0k 0B 100% /dev
> /dev/md0 ufs 29M 2M 24M 7% /etc
> /dev/md1 ufs 4.4M 20k 4.0M 0% /root
> /dev/md2 ufs 4.4M 302k 3.8M 7% /var
> procfs procfs 4.0k 4.0k 0B 100% /proc
> devfs devfs 1.0k 1.0k 0B 100% /var/named/dev
> /dev/md3 ufs 19M 14k 17M 0% /tmp
>
>
> rescue-bsd# gpart show
> => 63 156301425 ad6 MBR (74G)
> 63 156296322 1 freebsd [active] (74G)
> 156296385 5103 - free - (2.5M)
>
> => 0 156296322 ad6s1 BSD (74G)
> 0 20480000 1 freebsd-ufs (9.8G)
> 20480000 1048576 2 freebsd-swap (512M)
> 21528576 53895168 4 freebsd-ufs (25G)
> 75423744 8388608 5 freebsd-ufs (4.0G)
> 83812352 30720000 6 freebsd-ufs (14G)
> 114532352 41763970 7 freebsd-ufs (19G)
>
> => 63 156301425 ad4 MBR (74G)
> 63 156296322 1 freebsd [active] (74G)
> 156296385 5103 - free - (2.5M)
>
> => 0 156296322 ad4s1 BSD (74G)
> 0 20480000 1 freebsd-ufs (9.8G)
> 20480000 1048576 2 freebsd-swap (512M)
> 21528576 53895168 4 freebsd-ufs (25G)
> 75423744 8388608 5 freebsd-ufs (4.0G)
> 83812352 30720000 6 freebsd-ufs (14G)
> 114532352 41763970 7 freebsd-ufs (19G)
>
> rescue-bsd# mount /dev/ad4s1 /mnt
> rescue-bsd# vi /mnt/etc/ssh/sshd_config
> rescue-bsd# umount /mnt/
>
> rescue-bsd# mount /dev/ad6s1 /mnt
> rescue-bsd# vi /mnt/etc/ssh/sshd_config
> rescue-bsd# umount /mnt/
>
> rescue-bsd# reboot
>
> I have opened the ssh port and saved the file
>
> Then I reboot the server in normal mode, but none of the settings seem to
> have been saved on reboot!
Are you *sure* you saved the file? I suggest checking *before*
rebooting -- I strongly suspect that you haven't. Maybe you
forgot to "write" from vi, maybe you forgot to set the disk
read-write, maybe something else, but before the reboot.
> Do i have to chroot in order for these to work? I tried to chroot, but
> there is no vi in order to edit the file?
Um, no, that's not necessary (or helpful).
Good luck.
More information about the freebsd-questions
mailing list