Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have installed openssh-server in my Ubuntu PC using apt-get install openssh-server. The version is 5.9.

Now, I would like to compile and install openssh-server version 6.2 from source codes. I have successfully downloaded the source codes, and run the following commands:

./configure make make install

I found that the new version of openssh-server was installed into /usr/local/sbin/. The old version of openssh-server was in /usr/sbin/.

I found that the service script in /etc/init.d/ssh is still pointing to /usr/sbin/. And the old openssh-server (v5.9) is still running.

  1. How can I replace the old openssh-server with the new openssh-server that I have just compiled and installed?
  2. How can I create a init.d script to start and stop the new openssh-server that I've compiled from source?
  3. How to start the new openssh-server on boot?
  4. When I install openssh-server using apt-get install, the config files will be installed into /etc/ssh/. If I compile and install it from source, where is the config file?

Thanks.

share|improve this question
    
Why don't you edit the init script (looks like there are 2 lines below each other that point to /usr/sbin/)? That would solve 1 and also solve question 2 and 3. –  Rinzwind Aug 2 '13 at 14:14
add comment

1 Answer 1

up vote 1 down vote accepted

I've just installed version 6.4p from source and the config files are placed in

> /usr/local/etc$ ll total 284
> -rw-r--r-- 1 root root 242153 Jan 10 21:20 moduli
> -rw-r--r-- 1 root root   1576 Jan 10 21:20 ssh_config
> -rw-r--r-- 1 root root   2583 Jan 13 09:46 sshd_config
> -rw------- 1 root root    672 Jan 13 09:28 ssh_host_dsa_key
> -rw-r--r-- 1 root root    610 Jan 13 09:28 ssh_host_dsa_key.pub
> -rw------- 1 root root    227 Jan 10 21:20 ssh_host_ecdsa_key
> -rw-r--r-- 1 root root    182 Jan 10 21:20 ssh_host_ecdsa_key.pub
> -rw------- 1 root root    985 Jan 13 09:28 ssh_host_key
> -rw-r--r-- 1 root root    650 Jan 13 09:28 ssh_host_key.pub
> -rw------- 1 root root   1679 Jan 13 09:28 ssh_host_rsa_key
> -rw-r--r-- 1 root root    402 Jan 13 09:28 ssh_host_rsa_key.pub

To get the old version removed, I've set up the new one to run on a different port, copied the init script of the old version and modified it to point to the new installed one. I can now have the two versions running so I can test the new install, I'm keeping the old one around for a day or so in case something goes pear shaped so I've still got access (my server is totally remote). Once I'm happy, I can just remove the old version using apt, clean up any config files I may still have lying around and then reboot. Good luck!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.