linux 远程连接的配置文件为:/etc/ssh/sshd_config  , 如想要禁止root用户登陆,更改连接端口可对此文件做如下设置:

1、首先创建一个普通用户如:  # useradd username

                            # passwd username

2、vi /etc/ssh/ssh_config 

  做如下修改

  1) 将Port 22  改为 Port  2345  (注意: 2345 为你自己想要设置的远程连接端口,可自己设置)

  2) 将#PermitRootLogin no设置为: PermitRootLogin no 即将前边的#去掉.

     将#PermitEmptyPasswords no 设置为: PermitEmptyPasswords no

     将#UseDNS no  设置为:  UseDNS no

     将#GSSAPIAuthentication no  设置为: GSSAPIAuthentication no

3、保存退出,使用username用户登陆 设置端口为:2345,则可登陆.