考试首页 | 考试用书 | 培训课程 | 模拟考场 | 考试论坛  
  当前位置:Linux认证 > 红帽认证 > 红帽认证辅导 > 文章内容
  

RHCE7认证学习笔记:管理OpenSSH服务

来源:Linux社区 [ 2016年2月13日 ] 【

1、使用ssh远程连接服务器

ssh IP ,如果不指定用户名,默认使用当前的用户名
指定用户名登陆:
ssh -l username IP
ssh root@IP

ssh RedHat@localhost

ssh登陆成功后,会在用户的家目录下生成.ssh的文件夹,里面记录了用户的公钥指纹:
[root@linuxidc ~]# ssh redhat@localhost
The authenticity of host 'localhost (::1)' can't be established.
ECDSA key fingerprint is d0:f6:7b:6f:6a:c3:c6:70:e6:70:17:f5:0f:9d:38:6a.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
redhat@localhost's password: 
Last login: Wed Dec 31 14:46:34 2014

[root@linuxidc ~]# cd .ssh/
[root@linuxidc .ssh]# ls
known_hosts
[root@linuxidc .ssh]# cat known_hosts 
localhost ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEIjqNXDMYHmFNDlk+b3KP3TrefQ29vCFglzlIJ2UY3W+sTo7O+gCAgmPYHtO7qyaHnhttgl/dson31i2uoXEpM=

如果SSH是另一台相同的IP地址的机器SSH,那么则无法连接,这时候需要删除.ssh下面的known_hosts文件

SSH连接过去,如果需要使用图形化界面打开firefox等程序,则需要加x选项,并且需要在本地机器上安装Xmanager和在Xshell终端中开启X11转发:
[root@linuxidc ~]# ssh redhat@localhost -X

RHCE7认证学习笔记9——管理OpenSSH服务

RHCE7认证学习笔记9——管理OpenSSH服务

    Xshell终端上启动firefox

[redhat@linuxidc ~]$ firefox &

RHCE7认证学习笔记9——管理OpenSSH服务

首页 1 2 3 尾页
本文纠错】【告诉好友】【打印此文】【返回顶部
将考试网添加到收藏夹 | 每次上网自动访问考试网 | 复制本页地址,传给QQ/MSN上的好友 | 申请链接 | 意见留言 TOP
关于本站  网站声明  广告服务  联系方式  站内导航  考试论坛
Copyright © 2007-2013 中华考试网(Examw.com) All Rights Reserved