Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Jun 2015 10:28:23 -0400
From:      Lowell Gilbert <freebsd-questions-local@be-well.ilk.org>
To:        Norman Khine <norman@khine.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: edit sshd_config from freebsd8_rescue
Message-ID:  <44mvzivbaw.fsf@lowell-desk.lan>
In-Reply-To: <CAKgQ7U%2BzeKcZpgEaV5W7YtDORZtW%2Bq1ugiS7q3LgwZpRq76u5Q@mail.gmail.com> (Norman Khine's message of "Mon, 29 Jun 2015 11:38:25 %2B0100")
References:  <CAKgQ7U%2BzeKcZpgEaV5W7YtDORZtW%2Bq1ugiS7q3LgwZpRq76u5Q@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Norman Khine <norman@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44mvzivbaw.fsf>