linux搭建SSH服务器

搭建ssh服务器

1.安装ssh服务器:sudo apt-get install openssh-server

 2.查看ssh配置文件:vim /etc/ssh/sshd_config

# Package generated configuration file
# See the sshd_config(5) manpage for details

# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#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
HostKey /etc/ssh/ssh_host_ed25519_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 1024

# Logging
SyslogFacility AUTH
88 lines yanked         

# Authentication:
LoginGraceTime 120
PermitRootLogin prohibit-password
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

                                      1,1           Top

 说明:

  Port 22  //默认使用22端口,也可以自行修改为其他端口,但登录时要打上端口号
  #ListenAddress   //指定提供ssh服务的IP,这里我注释掉。
  PermitRootLogin   //禁止以root远程登录
  PasswordAuthentication  yes  //启用口令验证方式
  PermitEmptyPassword   //禁止使用空密码登录
  LoginGraceTime  1m   //重复验证时间为1分钟
  MaxAuthTimes   3    //最大重试验证次数
  保存修改好的配置,退出。

3.我们先不修改,先择启动服务器

4.使用SSH客户端登录

(1)Linux客户机
  # ssh 192.168.1.100   //输入服务器IP登录,不加用户名默认以root身份登录
  或者
  # ssh hui@192.168.1.100   //以hui身份登入服务器


(2).windows下使用远程登录客户端登录
  时下最流行的是putty这款登录软件,无需安装,下载下来就可以使用,简单、方便、安全!
  ·当服务器使用口令验证方式时,只需输入用户名和密码即可

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

卷积神经网络

你的支持是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值