复制的 SSH - 不能 运行 - 在哪里编辑

Copied SSH - cant RUN - where to edit

我像这样将 SSH 复制到 运行 第二个 SSH 实例:

http://ubuntuforums.org/showthread.php?t=1497376

但是当我开始服务时,我得到

service started [OK]

之后我使用 service status 并且服务响应 sshd2 service stopped

我 运行 /usr/sbin/sshd2 -p 22 -D -d -e 我收到以下错误消息:

bind to port 22 on 0.0.0.0 failed - Address already in use

我不知道在哪里和编辑什么才能得到它运行宁在端口我想让它在 运行 上(我需要 ssh1 到 运行 在 22 和 ssh2到 运行 2200)..

我的问题是:如何解决这个问题以便 sshd2 服务启动?

这是红帽(类似)服务器的指南

1) Create copy of sshd config and name it as your new sshd instance

# cp -p /etc/ssh/sshd_config /etc/ssh/new_sshd_config

2) Create copy of sshd init.d file and name it as your new sshd instance

# cp -p /etc/rc.d/init.d/sshd /etc/rc.d/init.d/new_sshd

3) Bind pam.d files

# cd /etc/pam.d/
# ln -s sshd new_sshd

4) Edit your new config

# mcedit /etc/ssh/new_sshd_config
a) At the bottom of the file add:
    a1) Port (portnumberyouwant)
    a2) PidFile=/var/run/new_sshd.pid
    a3) AllowUsers "users you want to allow"

5) Edit your old config

# mcedit /etc/ssh/sshd_config
a) At the bottom of the file add:
    a1) Port (standardportnumber)
    a2) DenyUsers "users you want to deny"

6) Edit your new init.d file

# mcedit /etc/rc.d/init.d/new_sshd
a) Edit following:
    a1) prog="new_sshd"
    a2) SSHD=/usr/sbin/new_sshd
    a3) PID_FILE=/var/run/new_sshd.pid
b) Add following:
    b1) OPTIONS=' -f /etc/ssh/new_sshd_config '

7) Try your new daemon

# service new_sshd start

8) Check if working

# service new_sshd status

9) If OK, run following commands:

# chkconfig --add new_sshd
# chkconfig --list | grep new_sshd
    Expected output:
    new_sshd       0:off   1:off   2:on    3:on    4:on    5:on    6:off

Now you have your 2nd ssh daemon set up. At this moment, you can edit ip tables (If needed.)