计算机网络--ssh远程登陆(思科模拟器)

Ø 远程登录条件:
a. 被登录方开启远程登录功能
b. 双方能够相互通信
Ø ssh 远程登陆(采用密文加密、推荐)
○ 步骤如下
§ R1作为登录方 192.168.20.254
§ R2作为被登录方 192.168.20.1
1) R1配置IP地址打开端口
Router>en
Router#conf
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int f0/0
%Invalid interface type and number
Router(config)#int g0/0
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up
Router(config-if)#ip add 192.168.20.254 255.255.255.0

		2) R2配置IP地址打开端口
		
		Router>en
		Router#conf
		Configuring from terminal, memory, or network [terminal]? 
		Enter configuration commands, one per line. End with CNTL/Z.
		Router(config)#int g0/0
		Router(config-if)#no shutdown
		Router(config-if)#
		%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up
		%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up
		Router(config-if)#ip add 192.168.20.1 255.255.255.0
		
		3) R2配置SSH
		
		Router(config)#ip domain-name zqh.com
		Router(config)#crypto key generate rsa
		% Please define a hostname other than Router.
		Router(config)#hostname R2
		R2(config)#crypto key generate rsa
		The name for the keys will be: R2.zqh.com
		Choose the size of the key modulus in the range of 360 to 2048 for your
		General Purpose Keys. Choosing a key modulus greater than 512 may take
		a few minutes.
		
		How many bits in the modulus [512]: 1024
		% Generating 1024 bit RSA keys, keys will be non-exportable...[OK]
		
		R2(config)#username zqh password 123456   //配置登录的用户名以及密码
		*3? 1 0:2:35.754: %SSH-5-ENABLED: SSH 1.99 has been enabled 
		R2(config)#line vty 0 4                                       //允许5个用户登录
		R2(config-line)#transport input ssh
		R2(config-line)# login local
		R2(config-line)#exit
		R2(config)#enable password 123456           //设置特权模式密码
		
		
		4) R1通过SSH远程登录R2
		
		Router#ssh -l zqh 192.168.20.1                   //ssh -l 远程登录用户名   被登录方IP
		Open
		Password: 
		R2>en
		Password: 
		Password: 
		R2#conf
		Configuring from terminal, memory, or network [terminal]? 
		Enter configuration commands, one per line. End with CNTL/Z.
		R2(config)#
		R2#

拓扑

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Gnome Terminal是Linux操作系统下的一款终端仿真器,可以用来执行命令和管理远程服务器。SSH是一种安全的远程访问协议,可以通过加密通信在客户端和服务器之间进行安全的远程操作。 要在Gnome Terminal中执行SSH远程命令,首先需要确保已经安装了SSH客户端。在终端中输入以下命令可以检查是否已安装SSH客户端: ``` ssh -V ``` 如果已经安装则会显示SSH的版本信息,否则需要先安装SSH客户端。 接下来,可以使用SSH命令连接远程服务器。使用以下格式的命令: ``` ssh username@host ``` 其中,"username"是登录远程服务器的用户名,"host"是远程服务器的IP地址或域名。执行以上命令后,系统会提示输入该用户的密码以完成登录。 成功连接到远程服务器后,就可以在Gnome Terminal中执行各种命令了。可以输入常用的Linux命令,如ls、cd、mv等,或者执行其他自定义的命令,如运行脚本等。 例如,要在远程服务器上列出当前目录下的文件和目录,可以输入以下命令: ``` ls ``` 要切换到其他目录,可以使用cd命令: ``` cd /path/to/directory ``` 要传输文件到远程服务器,可以使用scp命令。例如,将本地文件"file.txt"传输到远程服务器的目录"/path/to/destination"中,可以使用以下命令: ``` scp file.txt username@host:/path/to/destination ``` 以上就是使用Gnome Terminal和SSH进行远程执行命令的简单介绍。通过这种方式,可以在本地终端与远程服务器之间进行安全、方便的操作和管理。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值