Ubuntu11环境oepnssh-server安装配置
1、环境:
Ubuntu11.04
2、安装
Ubuntu提供了便利的apt工具,采用在线安装依赖包将会自动下载并安装。
- sudo apt-get install openssh-server
sudo apt-get install openssh-server
3、安装过程
下载过程视网速而定,很小的317K,如果不拨号很速度。
4、启动、停止ssh服务
- cd /etc/init.d
- //启动ssh服务
- service ssh start
- //停止ssh服务
- service ssh stop
- //重启ssh服务
- service ssh restart
cd /etc/init.d
//启动ssh服务
service ssh start
//停止ssh服务
service ssh stop
//重启ssh服务
service ssh restart
5、查看是否启动
如果有sshd服务说明ssh server已经启动,也可以直接start(别restart,这是重启),如果已经启动会提示。
ps -d|grep ssh
或者
pidof sshd
6、高级技巧
openssh-server安装后剩下的工作就是配置,配置信息位于sshd_config文件,一行一个配置,#开头的行表示注释。配置内容 key=value形式出现。
# Package generated configuration file
# See the sshd_config(5) manpage for details
# What ports, IPs and protocols we listen for
#监听端口,可以修改为其他端口默认22
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#监听IP,去掉注释标示监听所有ip地址
#ListenAddress 0.0.0.0
#协议版本号
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes
# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 768
# Logging
SyslogFacility AUTH
#ssh登陆日志写入AUTH系统日志设备,建议级别:VERBOSE
LogLevel INFO
# Authentication:
#连接ubuntu120秒内登陆ssh,否则断开。
LoginGraceTime 120
#是否允许root登陆ssh,如果设置可能su root失败
PermitRootLogin yes
#设置SSH在接收登录请求之前是否检查用户家目录和rhosts文件的权限和所有权。防止目录和文件设置成任何人都有写权限
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys
# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes
# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no
# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes
# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
#设置是否打印最用户最后一次登陆时间。例如:Last login: Tue May 17 13:58:15 2011 from localhost
PrintLastLog yes
#是否发送心跳包
TCPKeepAlive yes
#UseLogin no
#MaxStartups 10:30:60
#激活警示条,警示未经许可用户登陆
#Banner /etc/issue.net
# Allow client to pass locale environment variables
AcceptEnv LANG LC_*
#配置外部子系统,参数为子系统名字、执行命令
Subsystem sftp /usr/lib/openssh/sftp-server
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes
分享到:
相关推荐
Ubuntu11.04下安装ns-allinone-2.34的总结
找了好久才找到的,国内还没有有下载 linux vmware patch linux ubuntu 11.04 11.10 vmware linux-2.6.39 and linux-3.0.1 patch vmware补丁
最新的Ubuntu 11.04安装指南(详细图解)
ubuntu11.04的详细安装方法,其中包括自动分区和手动分区的步骤,希望能对广大用户有帮助!
百度承不欺我,ubuntu-16.04.6-desktop-amd64.iso镜像文件,挣点积分换流量
ubuntu11.04安装wine1.3的图文方法。 ubuntu11.04安装wine1.3的图文方法。 ubuntu11.04安装wine1.3的图文方法。 ubuntu11.04安装wine1.3的图文方法。
Ubuntu 11.04 安装后要做的20件事情 Ubuntu 11.04 安装后要做的20件事情 Ubuntu 11.04 安装后要做的20件事情
安装ubuntu11.04的安装,亲测可用,放心下载 Ubuntu(又称乌班图)是一个以桌面应用为主的开源GNU/Linux操作系统,Ubuntu 是基于Debian GNU/Linux,支持x86、amd64(即x64)、ARM和ppc架构,由全球化的专业开发团队...
Ubuntu 11.04 安装后要做的20件事情.txt Ubuntu 安装 软件 配置 系统
Linux Ubuntu 11.04 安装手册,主要说明分区和驱动
硬盘全新安装ubuntu11.04 硬盘全新安装ubuntu11.04
最新桌面版乌班图更加人性化,效果和MAC OS相差无几了。 如果你不是微软的依赖者,我想该系统就是你的最佳选择了。 该种子来自乌班图官方服务器,可直接下载使用。速度可佳!
Ubuntu11.04 下载
CSI Tool 集成安装包(适配Ubuntu 11.04系统,Intel 5300 无线网卡) csitools
Ubuntu 11.04安装Ruby on rails 连接MySQL数据库.pdf
本人在VMware虚拟机 安装的 Ubuntu 11.04 & Ubuntu server 12.04 上的安装记录 多部电脑/服务器验证通过
最快最全的Ubuntu11.04源,速度超快
ubuntu 11.04 3D安装及事项,实现完美的3D效果,及优化开机速度
这是我在在Ubunt-11.04上成功搭建hadoop-0.20.2集群云平后,写出来的实验指导,确实可用。我同实验室的同学按时这个实验指导已经成功做成了。