Initial FreeBSD configuration: configuring SSH and installing mc
This article describes the initial steps of how to configure FreeBSD by configuring ssh and installing Midnight Commander for comfortable work.
All the steps below should be done under superuser (root). Before you start, check your Internet connection.
Midnight Commander installation
Midnight Commander is a file manager, analog of Norton Commander for Windows. It will help you to quickly edit configuration files with user-friendly editor. To install mc, run the following commands:
cd/usr/ports/misc/mc make install clean
Also run the command below to make mc available in the command line right after installation:
Now mc is availiable.
SSH server configuration
Next step is to configure SSH server to work with FreeBSD through network (remote access). For this we need to open file /etc/ssh/sshd_config by mc (press F4 to edit file) and change the following options:
Port 22 Protocol 2 LoginGraceTime 60 PermitRootLogin no PasswordsAunthentication yes PermitEmptyPasswords no UseDNS no
These are minimal options to run SSH server.
The next step is to start SSH server automatically at boot time. Add the following lines to /etc/rc.conf file:
Now start SSH server:
Authorize yourself in the system using your login and password.
- frank is login name of your user in the system;
- 192.168.1.1 is your server IP address in FreeBSD.
But, if you use Windows you will need to install additional application named Putty in order to connect to your FreeBSD server by SSH.
If you need to have a remote access as superuser you will need to add your current user (frank in this example) to the group wheel by the following command:
pw groupmod wheel -m frank
If you have logged in as user frank in SSH, the next command will make you superuser:
Finally the system will ask you the password for superuser (root).