How to enable sshd from the FreeBSD 8 install’s fixit environemnt?
So there are lots of documents out there on how to do something in fixit and some times (most the time) those are long drawn out processes with a lot of typing.
What if you could copy and paste? Well, you can’t. But you could if you could ssh in right.
So lets boot to the FreeBSD 8 Installation DVD and see if we can enable sshd.
I just got it to work so let me document my steps:
ifconfigto find what ethernet controller you have. Mine was
- Now assign an IP address. Make sure to find an open IP Address that is not already in use.
fixit# ifconfig em0 inet 192.168.0.25 netmask 255.255.255.0
That is it for configuring your IP address. You may be asking yourself, what about the DNS server and the default route? Well, you only need those if you are connecting from a different subnet and since you are booted to a fixit environment, I assume you are on the same subnet. Just in case you aren’t, you can enable DNS and give yourself a default route with these commands:
echo nameserver 192.168.0.1 > /etc/resolv.conf
route add default 192.168.0.1
- Create the directory where the default sshd configuration and keys are stored.
fixit# mkdir /etc/ssh
- Copy the sshd_config to this directory.
fixit# cp /dist/etc/ssh/sshd_config /etc/ssh
- Change the configuration file to allow root logins.
fixit# echo PermitRootLogin yes >> /etc/ssh/sshd_config
- Create the rsa1, rsa, and dsa keys.
ssh-keygen -t rsa1 -b 1024 -f /etc/ssh/ssh_host_key -N ”
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ”
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ”
- Make sure that root can find a shell.
fixit# ln -s /mnt2/bin/csh /bin/csh
- Make sure root has a home directory.
fixit# mkdir /root
- Start the
- Prepare the environment for login. We probably want similar environment variables, because the defaults won’t work, since most our binary files are in subdirectories of /mnt2.
env > /root/env
echo ‘setenv ENV $HOME/env’ > /root/.cshrc
echo sh >> /root/.cshrc
- Now try to connect using ssh and the root user. There should be no password requested. If you need a windows ssh client, use PuTTY.Note: There may be some errors on setting the environment variables when you log in but they aren’t going to hurt anything and the ones you need should work.
Well, that was a lot easier than I thought it would be. Only took me a short time to figure out.
Hopefully if you search any search engine for this term, you will find this post:
freebsd fixit sshd
Copyright ® Rhyous.com – Linking to this article is allowed without permission and as many as ten lines of this article can be used along with this link. Any other use of this article is allowed only by permission of Rhyous.com.