3

At work we have freeBSD testmachine. And we have a PHP script that uses SSH2 protocol to connect with the freeBSD server. With this script I'm not able to connect to the freeBSD server. I wanted to install it, but I'm not sure where to find the right source to compile.

The connection can be made with a different machine, but isntalling a new distro isn't the solution right now.

I can connect to the server over ssh, but not with the ssh2 protocol in PHP (http://nl.php.net/ssh2).

1
  • What version of FreeBSD? What's the output of "uname -srm"? How about the version of ssh: "ssh -v"? Commented Dec 2, 2009 at 17:27

4 Answers 4

8

FreeBSD has OpenSSH-server installed by default

Enable it with sshd_enable=YES in rc.conf, and run "sh /etc/rc.d/sshd start"

Edit: Make sure "Protocol 2" is enabled in /etc/ssh/sshd_config and reload sshd with "sh /etc/rc.d/sshd reload".

12
  • I can connect to the server with SSH. That ain't the problem. But not by the SSH2 protocol. this is different from SSH1. Commented Dec 2, 2009 at 14:41
  • Please paste the output from "grep 'Protocol' /etc/ssh/sshd_config" Commented Dec 2, 2009 at 14:55
  • sshd_enable="YES" is allready set Commented Dec 2, 2009 at 14:56
  • FreeBSD's SSH server uses tcp_wrappers. Make sure that /etc/hosts.allow allows ssh access from the server running the php/ssh script. Commented Dec 2, 2009 at 17:22
  • I repeat, please post the output from "grep 'Protocol' /etc/ssh/sshd_config" Commented Dec 2, 2009 at 21:25
2

make sure sshd_enable="YES" is in /etc/rc.conf

/etc/rc.d/sshd keygen

/etc/rc.d/sshd start

SSHv2 is allowed by default, but freebsd also allows sshv1. I set protocol to 2 only, but this should be option for what you're trying to accomplish.

0

Either build it by doing

cd /usr/ports/security/ssh2 make && make install 

or install it using

pkg_add -r ssh2 

This should do the trick.

Best wishes, Fabian

1
  • OpenSSH (the ssh server/client included in the base FreeBSD system) supports the SSH2 protocol (and only SSH2) by default since SSH1 has security issues. The installation of the ssh2 port shouldn't be necessary. Commented Dec 2, 2009 at 17:19
-2

Open terminal and use bellow commands to install ssh2

cd /usr/ports/security/ssh2 make && make install

or use

pkg install ssh2

this should work properly

1
  • 1
    I don't think this adds anything that Halfdan's answer doesn't - and that has been criticised for being wrong. Commented Feb 24, 2016 at 7:42

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.