文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>openssh的设置

openssh的设置

时间:2005-10-09  来源:thestones

如果你在家里或者其它地方,怎样控制你的服务器,你可能会想到用telnet,本来是可以的,但是由于telnet用的是明码传输,容易给那些不怀好意者可乘之机,所以我们用openssh来代替telnet

openssh的设置
1]卸载原来的2.9x版,2.9x版有bug,不安全:
rpm –e openssh

2]最新软件包下载:

ftp://ftp.openbsd.org/pub/OpenBSD/O...sh-3.4p1.tar.gz

3]安装软件:
tar zxvf openssh-3.4p1.tar.gz
cd openssh-3.41
./configure --prefix=/usr/local/ssh
--sysconfdir=/etc/ssh
--with-tcp-wrappers
--with-ipv4-default
--with-md5-passwords
make
make install
注:安装完成以后,会自动生成主机密钥,还会提示需要sshd用户帐号,可用useradd加一个sshd用户。
install /contrib/redhat/sshd.pam /etc/pam.d/sshd
cp contrib/redhat/sshd.init /etc/rc.d/init.d/sshd
chkconfig --level 3 sshd on ;配置成系统服务

4]配置openssh之/etc/ssh/ssh_config文件
vi /etc/ssh/ssh_config
Host *
ForwardAgent no
ForwardX11 no
RhostsAuthentication no
RhostsRSAAuthentication no
RSAAuthentication yes
PasswordAuthentication yes
BatchMode no
CheckHostIP yes
StrictHostKeyChecking ask
IdentityFile ~/.ssh/identity
Port 22
Cipher 3des
EscapeChar ~

5]配置openssh之/etc/ssh/sshd_config文件
vi /etc/ssh/sshd_config
Port 22
ListenAddress 0.0.0.0
ListenAddress ::
HostKey /etc/ssh/ssh_host_key
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
KeyRegenerationInterval 3600
ServerKeyBits 768
SyslogFacility AUTH
LogLevel INFO
LoginGraceTime 600
#PermitRootLogin yes #还是不要让root直接登录为妙!
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
RhostsAuthentication no
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
IgnoreUserKnownHosts no
PasswordAuthentication yes
PermitEmptyPasswords no
Subsystem sftp /usr/local/ssh/libexec/sftp-server

6]配置用户的加密密钥
useradd test
passwd test
su test
ssh-keygen -d
出现提示请回车并输入passwd,再次输入passwd。
注:这个密码是系统加密运算时用到的,登录时还用原来密码。

7]启动服务
/etc/rc.d/init.d/sshd start

8]在客户端用test帐号进行测试。

相关阅读 更多 +
排行榜 更多 +
全民飞机空战手机版

全民飞机空战手机版

飞行射击 下载
弗拉格职业射手手机版

弗拉格职业射手手机版

飞行射击 下载
反射单元2

反射单元2

飞行射击 下载