ssh服务

作者: 胖虎喜欢小红 | 来源:发表于2020-01-25 21:42 被阅读0次
openssh-service  提供服务
openssh-clients   客户端

sshd服务的端口号----22

安装

[root@biudefor ~]# yum install -y openssh*
1.服务器端启动服务:
systemctl  start  sshd
2.关闭防火墙和selinux

登录方式

远程登录:
[root@biudefor ~]# ssh root@192.168.246.114
参数解释:
root 用户默认不写为root,也可以使用其他用户
-p:prot端口,指定端口,如果端口修改了需要指定

无密码登陆(ssh密钥认证)

[root@biudefor ~]# ssh-keygen    #一直回车
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:jZzWLVFDnhxmiuF7LTuSXiMNMkqPgDMZVLN68M1AI98 root@biudefor
The key's randomart image is:
+---[RSA 2048]----+
| o.=    .  .B    |
|. + =  . o B +   |
|.. + E  o o +    |
| ++ +  . * +     |
|=..o.oo S * o    |
| o.o + + = +     |
|    o . + *      |
|       . + o     |
|        .        |
+----[SHA256]-----+
[root@biudefor ~]# ls .ssh
id_rsa  id_rsa.pub  known_hosts

id_rsa  ---私钥
id_rsa.pub  ---公钥
known_hosts  ----确认过公钥指纹的可信服务器列表的文件
authorized_keys ---授权文件,是传输过公钥到对方服务后会自动重命名生成的

3.拷贝公钥给对方:
#ssh-copy-id ip地址
ip地址:指的是对方服务器

4.远程连接的时候就不用输入密码了

修改端口号

修改配置文件:
# vim /etc/ssh/sshd_config
#Port 22   #将注释去掉,修改端口号可以修改为自定义的。
[root@biudefor ~]# systemctl restart sshd

相关文章

  • Scientific Linux 7.5 启动SSH

    1.安装SSH服务 2.查看SSH服务 3.启动SSH服务

  • Ubuntu开启ssh服务

    检查ssh是否已经开启 安装ssh服务 修改ssh配置文件 启动ssh服务

  • 第7章 网络服务及安全

    第7章 网络服务及安全 SSH服务 SSH协议简介 Ubuntu安装SSH SSH服务配置 使用putty登陆SS...

  • linux学习——远程服务器管理工具SSH

    2018-08-27 SSH是什么 服务器安装SSH服务 客户端安装SSH客户端 SSH客户端连接服务器 SSH ...

  • SSH服务的搭建

    管理服务 1、什么是SSH? SSH基础服务,SSH是远程连接Linux,管理Linux的服务。Secure Sh...

  • Linux安装ssh

    查看ssh服务状态: sudo service ssh status1.没有安装ssh服务没有安装ssh2.安装了...

  • SSH基本使用

    目标 了解SSH是什么 服务端安装SSH 客户端安装SSH ssh连接远程服务 ssh config配置讲解(多服...

  • 远程登录linux

    远程登录Linux需要打开ssh服务 终端利用ssh登录远程服务器 安装ssh服务: yum install ss...

  • ssh 密钥方式远程链接linux

    查看 ssh 运行服务 查看 ssh 服务监听的端口 默认监听的 端口 是 22 端口 修改 ssh 服务端口(c...

  • 8月21日 批量管理

    远程管理服务配置文件 etc/ssh/sshd_config ssh服务端配置文件 /etc/ssh/ssh_co...

网友评论

      本文标题:ssh服务

      本文链接:https://www.haomeiwen.com/subject/slarthtx.html