阅读 86

sshd做移动硬盘,linux中sshd进程是什么

######sshd服务######sshd

两台虚拟机、ip、主机名更改

删除~/.ssh

##1.sshd概述###

shd=secure壳

可以通过网络在主机上启动外壳程序的服务

客户端软件

sshd

连接方法:

链接到ssh username@ip ##文本模式

ssh -X username@ip ##可以在链接成功后启动图形

注意:因为第一次连结陌生主机是建立认证档,所以系统会询问您是否要建立。 必须进入yes树。 链接此主机两次时,会生成~/.ssh/know_hosts文件,因此不需要再次输入是远程复制。

scp file root@ip:dir ##上传(dir是绝对路径) ) ) ) ) ) ) ) ) )。

scp root @ IP :文件dir # #下载

###2.sshd的key认证####

1 .生成认证密钥

[ root @ server~] #用于生成ssh-keygen # #密钥的命令

生成公共/私有密钥。

enterfileinwhichtosavethekey (/root/. ssh/id _ RSA ) : ##指定用于存储加密字符的文件。 (使用默认设置) ) ) ) ) ) ) ) ) ) ) )。

设置enter pass phrase (emptyfornopassphrase ) : ##密码(使用空密码) )

确认entersamepassphraseagain : # #密码

youridentificationhasbeensavedin "/root/. ssh/id _ RSA ".# # #私钥(

yourpublickeyhasbeensavedin "/root/. ssh/id _ RSA.pub ".# #公钥(

The key fingerprint is:

8336061: e 4:6 e :6 e :6 e :5133603 a :4 b :4 d 7:3 c :1 b :2 f :2 e 8:3 b 0:5 b 033:5 d rooot

the key’srandomartimageis :

-[ RSA 2048]----

| o . |

| o o o o |

| * .=|

| .==.=|

| . S . o . |

| o … .E |

|.|

| …o |

| … |

------------

2 .加密服务

[ root @ server.ssh ] # ssh-copy-id-I/root/. ssh/id _ RSA.pub root @ 172.25.254.200 # #加密sshd服务

theauthenticityofhost‘172.25.254.200 (172.25.254.200 ) can’tbe established。

ecdsakeyfingerprintiseb 33602433600 e 336007336096336093602600433600 b 133600433600 c 233603733600 c 3360736078:2 d 33:0 bb

areyousureyouwanttocontinueconnecting (是/否)? 是

/usr/baddy/ssh-copy-id : info : attemptingtologinwiththenewkey (s ),tofilteroutanytharealreadyinstalled

/usr/baddy/ssh-copy-id : info :1 key (s ) remaintobeinstalledifyouarepromptednowitistoinstallthenewkeys

root @ 172.25.254.200’s password :

编号密钥(s ) added: 1

Now try logging into the machine,with :“ssh‘root @ 172.25.254.200”

andchecktomakesurethatonlythekey (s ) you wanted were added。

[root@server .ssh]# ls

authorized _ keys id _ r said _ RSA.pub known _ hosts

^

如果显示此文件,则表示加密已完成

3 .分发密钥

scp/root/. ssh/id _ RSA root @ 172.25.254.1003360/root/. ssh /

4 .测试

客户主机(172.25.254.100 ) ) )。

ssh root@172.25.254.200 ##连接时直接登录发现不需要根登录系统的密码验证

####3.sshd的安全设置###

78是否允许用户使用登录到78passwordauthenticationyes|no##系统的密码验证sshd

48权限是|否# #是否允许根用户通过sshd服务的认证

52 Allowusers student westos ##设定用户的白名单。 出现白名单并默认从列表中消失的用户不能使用sshd。 白名单用户是指锁定一方的用户。 和黑名单一样。

53 Denyusers westos ##设置用户黑名单,出现黑名单并默认从列表中消失的用户可以使用sshd

#### .添加sshd凭据####

vim /etc/motd ##文件的内容是登录后显示的信息

#####55 .用户登录审计#####

1.w ##显示使用当前系统的用户

-f ##显示使用源

-i ##显示IP

/var/run/utmp

2 .显示使用2.last ##退出的用户信息

/var/log/wtmp

3.lastb ##尝试登录但未成功的用户

/var/log/btmp


文章分类
代码人生
版权声明:本站是系统测试站点,无实际运营。本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 XXXXXXo@163.com 举报,一经查实,本站将立刻删除。
相关推荐