From a264b85ac244776ca431420b93ac171796b97bd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=95=8F?= <12071597+zhao-min-g@user.noreply.gitee.com> Date: Mon, 6 May 2024 12:38:37 +0800 Subject: [PATCH] zy --- "\350\265\265\346\225\217/20240429 ssh.md" | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 "\350\265\265\346\225\217/20240429 ssh.md" diff --git "a/\350\265\265\346\225\217/20240429 ssh.md" "b/\350\265\265\346\225\217/20240429 ssh.md" new file mode 100644 index 0000000..c6d46b4 --- /dev/null +++ "b/\350\265\265\346\225\217/20240429 ssh.md" @@ -0,0 +1,78 @@ +#### 笔记 + +##### ssh + +1.改交换机名字,设置特权密码 + +~~~js +(config)# hostname Re +(config)# enable secret 111 +~~~ + +2.给交换机设置一个域名 + +~~~js +(config)#ip domain-name qq.com + //(config)#ip domain-lookup 取消域名查找功能,避免输错命令卡死 +~~~ + +3.生成一个密钥 + +~~~ js +(config)#crypto key generate rsa + // remove 删除密钥 +~~~ + +4.输入密码长度,越大越安全,最大2048 + +~~~js +How many bits in the modulus [512]: 2048 +~~~ + +5.开启版本2 + +~~~js +(config)# ip ssh version 2 +~~~ + +6.开启虚拟端口供ssh使用,0-15个虚拟线路,表示15个可开启的虚拟线路 + +~~~ js +(config)#line vty 0 15 +~~~ + +7.开启本地用户登录 + +~~~js +(config-line)#login local +~~~ + +8.允许ssh登录,all是允许所有登录,none禁止用所有登录 + +~~~js +(config-line)#transport input ssh +~~~ + +9.设置一个本地用户admin,密码为123,用户密码都可以自定义设置 + +~~~js +(config)#username admin password 123 +~~~ + +10.登录 + +ssh [-l login_name] 指定登录用户名,如果不指定,将使用本地登录用户名 + +ssh [-p port_number] 指定远程 SSH 服务器监听的端口号,默认为 22 + +ssh [-i identity_file] 指定身份验证文件(公钥),用于身份验证,也可以通过密码进行身份验证 + +remote_host:要连接的远程主机地址 + +~~~js +c:\>ssh -l admin 192.168.1.2 //使用ssh,指定用户admin,登录192.168.1.2 主机 +~~~ + +#### 作业 + +![捕获4.PNG](https://img2.imgtp.com/2024/04/29/qhzZDipe.PNG) \ No newline at end of file -- Gitee