国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Linux服務(wù)器配置SSH免密碼登錄后,登錄仍提示輸入密碼(一次真實(shí)的問題排查解決記錄)

這篇具有很好參考價(jià)值的文章主要介紹了Linux服務(wù)器配置SSH免密碼登錄后,登錄仍提示輸入密碼(一次真實(shí)的問題排查解決記錄)。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

我們知道兩臺Linux服務(wù)器機(jī)器之間如果使用ssh命令登錄或scp/rsync命令傳輸文件每一次都需要輸入用戶名相對應(yīng)的密碼,如果要免密碼,則需要對兩臺Linux服務(wù)器機(jī)器之間進(jìn)行SSH互信。

一.SSH介紹

1.SSH互信原理

雖然這是廢話,也希望大家了解一下。

SSH(Secure Shell)是一種安全的傳輸協(xié)議,它可以讓Linux系統(tǒng)中的服務(wù)器和客戶端之間進(jìn)行安全可靠的通訊,它常被用于在本地網(wǎng)絡(luò)中的多臺計(jì)算機(jī)之間實(shí)現(xiàn)遠(yuǎn)程登錄,文件傳輸和系統(tǒng)管理。

SSH使用“加密”的傳輸方式,以保證客戶端和服務(wù)器之間的通訊安全。具體而言,SSH使用加密技術(shù)(默認(rèn)加密技術(shù):rsa,加密位:2048位)將用戶數(shù)據(jù)和控制指令加密,以保護(hù)數(shù)據(jù)不被第三方攔截。
SSH可以驗(yàn)證客戶端的身份,確保只有授權(quán)的用戶才能訪問服務(wù)器。

要在Linux系統(tǒng)中運(yùn)行SSH,需要兩個軟件:一個是服務(wù)器端的軟件,另一個是客戶端的軟件。服務(wù)器端的軟件叫做OpenSSH-Server,主要實(shí)現(xiàn)SSH服務(wù)器功能。它可以處理SSH消息并執(zhí)行用戶指令,以實(shí)現(xiàn)遠(yuǎn)程登錄功能??蛻舳说能浖凶鯯SH-Client,會根據(jù)服務(wù)器端提供的信息將用戶指令加密,并且可以認(rèn)證服務(wù)器的身份。

2.SSH RPM包

OpenSSH所對應(yīng)的RPM包共有5個,

[root@rhel77 ~]# ls /mnt/Packages/openssh*
/mnt/Packages/openssh-7.4p1-21.el7.x86_64.rpm
/mnt/Packages/openssh-askpass-7.4p1-21.el7.x86_64.rpm
/mnt/Packages/openssh-clients-7.4p1-21.el7.x86_64.rpm
/mnt/Packages/openssh-keycat-7.4p1-21.el7.x86_64.rpm
/mnt/Packages/openssh-server-7.4p1-21.el7.x86_64.rpm

說明如下:

OpenSSH-RPM Packages
Packages名 說明
openssh-7.4p1-21.el7.x86_64.rpm openssh核心文件
openssh-askpass-7.4p1-21.el7.x86_64.rpm ?持對話框窗? 顯示 X系統(tǒng)
openssh-clients-7.4p1-21.el7.x86_64.rpm 客戶端軟件包
openssh-keycat-7.4p1-21.el7.x86_64.rpm openssh公鑰,私鑰文件
openssh-server-7.4p1-21.el7.x86_64.rpm 服務(wù)器端軟件包

3. SSH秘鑰文件介紹

目錄路徑:/root/.ssh/

[root@rhel77 .ssh]# cd ../.ssh/
[root@rhel77 .ssh]# pwd
/root/.ssh
[root@rhel77 .ssh]# ls -la
total 28
drwx------   2 root root   80 Jun  8 15:32 .
drwxrwxrwx. 17 root root 8192 Jun  9 08:33 ..
-rw-------   1 root root  395 Jun  8 15:32 authorized_keys
-rw-------   1 root root 1675 Jun  8 15:18 id_rsa
-rw-r--r--   1 root root  393 Jun  8 15:18 id_rsa.pub
-rw-r--r--   1 root root  346 Jun  8 15:31 known_hosts
[root@rhel77 .ssh]# 

其中:

id_rsa:私鑰,相當(dāng)于"鎖"。文件權(quán)限:600,不能更改。

id_rsa.pub:公鑰,相當(dāng)于"鑰匙"。文件權(quán)限:644,不能更改。

authorized_keys:認(rèn)證文件,記錄"別人"(即:對端)給你的公鑰“鑰匙”。文件權(quán)限:600,不能更改。

known_hosts:“指紋”文件,記錄首次SSH互信認(rèn)證"別人"(即:對端)留給你的“指紋”信息。文件權(quán)限:600,不能更改。

4.ssh配置文件sshd_config

目錄路徑:/etc/ssh

sshd日志默認(rèn)保存在/var/log/secure中

(cat /etc/ssh/sshd_config):

SyslogFacility AUTHPRIV

(cat /etc/rsyslog.conf):

authpriv.* ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?/var/log/secure

二.問題重現(xiàn)

1.環(huán)境信息

VMware CentOS7.9(IP:192.168.10.135)、RHEL7.7(IP:192.168.10.110)

防火墻及selinux關(guān)閉,參考(Chapter1):

Linux常規(guī)基礎(chǔ)配置_小黑要上天的博客-CSDN博客

2.兩臺機(jī)器實(shí)現(xiàn)openssh rpm安裝

-->RHEL7.7(ip:192.168.10.110)機(jī)器

[root@rhel77 /]# yum install -y openssh*
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
rhel7.7                                                                             | 2.8 kB  00:00:00     
Package openssh-server-7.4p1-21.el7.x86_64 already installed and latest version
Package openssh-7.4p1-21.el7.x86_64 already installed and latest version
Package openssh-clients-7.4p1-21.el7.x86_64 already installed and latest version
Package openssh-askpass-7.4p1-21.el7.x86_64 already installed and latest version
Package openssh-keycat-7.4p1-21.el7.x86_64 already installed and latest version
Nothing to do
[root@rhel77 /]# 

-->CentOS7.9(ip:192.168.10.135)機(jī)器

[root@centos79 ~]# yum install -y openssh*
已加載插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.bupt.edu.cn
 * extras: mirror.lzu.edu.cn
 * updates: mirror.lzu.edu.cn
base                                                                                | 3.6 kB  00:00:00     
docker-ce-stable                                                                    | 3.5 kB  00:00:00     
extras                                                                              | 2.9 kB  00:00:00     
updates                                                                             | 2.9 kB  00:00:00     
軟件包 openssh-cavs-7.4p1-22.el7_9.x86_64 已安裝并且是最新版本
軟件包 openssh-server-7.4p1-22.el7_9.x86_64 已安裝并且是最新版本
軟件包 openssh-7.4p1-22.el7_9.x86_64 已安裝并且是最新版本
軟件包 openssh-clients-7.4p1-22.el7_9.x86_64 已安裝并且是最新版本
軟件包 openssh-askpass-7.4p1-22.el7_9.x86_64 已安裝并且是最新版本
軟件包 openssh-ldap-7.4p1-22.el7_9.x86_64 已安裝并且是最新版本
軟件包 openssh-server-sysvinit-7.4p1-22.el7_9.x86_64 已安裝并且是最新版本
軟件包 openssh-keycat-7.4p1-22.el7_9.x86_64 已安裝并且是最新版本
無須任何處理
[root@centos79 ~]# 

3.兩臺機(jī)器機(jī)器實(shí)現(xiàn)ssh互信

-->RHEL7.7(ip:192.168.10.110)機(jī)器

命令:

cd ~

ssh-keygen

cd .ssh/

ls

ssh-copy-id 192.168.10.135

[root@rhel77 ~]# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): #強(qiáng)烈建議直接回車使用默認(rèn)路徑
/root/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase): #密鑰的密碼短語(建議留空則直接回車)
Enter same passphrase again:            #密鑰的密碼短語確認(rèn)(建議留空則直接回車)
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:jHTGpurRdAzUvx4haQJJRFR5bZiS3j5TNyuB85/SXWc root@rhel77
The key's randomart image is:
+---[RSA 2048]----+
|   ==oo+ +       |
|    o.+.= o      |
|     oo+==       |
|     .oXB = o    |
|      ++S= = o   |
|     + .+ = .   E|
|    o .  + = o o.|
|   . .    o + .  |
|    .      .     |
+----[SHA256]-----+
[root@rhel77 ~]# cd .ssh/
[root@rhel77 .ssh]# ls
id_rsa  id_rsa.pub  known_hosts
[root@rhel77 .ssh]# ssh-copy-id 192.168.10.135
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@192.168.10.135's password: 

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh '192.168.10.135'"
and check to make sure that only the key(s) you wanted were added.

[root@rhel77 .ssh]# 

-->CentOS7.9(ip:192.168.10.135)機(jī)器

命令:

cd ~

ssh-keygen

cd .ssh/

ls

ssh-copy-id 192.168.10.110

[root@centos79 ~]# 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:nK6khtCnoJB2o1aVfqVlTNpJHMug4QQ/3orcPqAgda4 root@centos79
The key's randomart image is:
+---[RSA 2048]----+
|   ..o ....      |
|    + o o+.      |
|     =. *o.      |
|  . oooo O       |
| + oo. .S        |
|B.o==..+         |
|*o=Booo .        |
|.+E o+ .         |
|.  ...o          |
+----[SHA256]-----+
[root@centos79 ~]# cd .ssh/
[root@centos79 .ssh]# ls
authorized_keys  id_rsa  id_rsa.pub  known_hosts
[root@centos79 .ssh]# ssh-copy-id 192.168.10.110
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@192.168.10.110's password: 

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh '192.168.10.110'"
and check to make sure that only the key(s) you wanted were added.

[root@centos79 .ssh]# 

4.ssh互信驗(yàn)證-問題重現(xiàn)

-->從RHEL7.7(ip:192.168.10.110)機(jī)器 ssh 到 CentOS7.9(ip:192.168.10.135)機(jī)器

ssh免密設(shè)置后仍然需要密碼,linux小常識,服務(wù)器,linux,ssh

-->從CentOS7.9(ip:192.168.10.135)機(jī)器 ssh 到 RHEL7.7(ip:192.168.10.110)機(jī)器

ssh免密設(shè)置后仍然需要密碼,linux小常識,服務(wù)器,linux,ssh

三. 問題解決梳理

1.兩臺機(jī)器文件權(quán)限驗(yàn)證(id_rsa,id_rsa.pub,authorized_keys,known_hosts)

-->RHEL7.7(ip:192.168.10.110)機(jī)器

[root@rhel77 /]# cd 
[root@rhel77 ~]# cd .ssh/
[root@rhel77 .ssh]# pwd
/root/.ssh
[root@rhel77 .ssh]# ls -l
total 16
-rw------- 1 root root  395 Jun  9 09:26 authorized_keys
-rw------- 1 root root 1679 Jun  9 09:26 id_rsa
-rw-r--r-- 1 root root  393 Jun  9 09:26 id_rsa.pub
-rw-r--r-- 1 root root  176 Jun  9 09:27 known_hosts
[root@rhel77 .ssh]# 

結(jié)論:文件權(quán)限無誤

-->CentOS7.9(ip:192.168.10.135)機(jī)器

[root@centos79 .ssh]# cd
[root@centos79 ~]# cd .ssh/
[root@centos79 .ssh]# pwd
/root/.ssh
[root@centos79 .ssh]# ls -l
總用量 16
-rw------- 1 root root  393 6月   9 09:27 authorized_keys
-rw------- 1 root root 1679 6月   9 09:23 id_rsa
-rw-r--r-- 1 root root  395 6月   9 09:23 id_rsa.pub
-rw-r--r-- 1 root root  176 6月   9 09:26 known_hosts
[root@centos79 .ssh]# 

結(jié)論:文件權(quán)限無誤

2.兩臺機(jī)器.ssh目錄權(quán)限驗(yàn)證

-->RHEL7.7(ip:192.168.10.110)機(jī)器

[root@rhel77 ~]# pwd
/root
[root@rhel77 ~]# ls -ld .ssh/
drwx------ 2 root root 80 Jun  9 09:27 .ssh/
[root@rhel77 ~]# 

結(jié)論:.ssh目錄權(quán)限為700,權(quán)限無誤

-->CentOS7.9(ip:192.168.10.135)機(jī)器

[root@centos79 ~]# pwd
/root
[root@centos79 ~]# ls -ld .ssh/
drwx------ 2 root root 80 6月   9 09:27 .ssh/
[root@centos79 ~]# 

結(jié)論:.ssh目錄權(quán)限為700,權(quán)限無誤

3.兩臺機(jī)器更改/etc/ssh/sshd_config文件配置

添加如下信息:

RSAAuthentication yes? ? ? ? ? ? ???#允許RSA密鑰
PubkeyAuthentication yes? ? ? ? ??#啟用公告密鑰配對認(rèn)證方式

################################################

添加位置:

RSAAuthentication yes
PubkeyAuthentication yes

# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
AuthorizedKeysFile ? ? ?.ssh/authorized_keys

################################################

重啟sshd,發(fā)現(xiàn)問題仍舊存在。

命令:

systemctl restart sshd

systemctl status sshd

4.問題點(diǎn)定位

最后,通過查看/var/log/secure,發(fā)現(xiàn)了問題的點(diǎn)

命令:

tail /var/log/secure -n 20

-->RHEL7.7(ip:192.168.10.110)機(jī)器

Jun  9 10:17:28 rhel77 sshd[12271]: Server listening on :: port 22.
Jun  9 10:17:28 rhel77 polkitd[948]: Unregistered Authentication Agent for unix-process:12264:668614 (system bus name :1.316, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
Jun  9 10:24:34 rhel77 sshd[12868]: Authentication refused: bad ownership or modes for directory /root
Jun  9 10:24:36 rhel77 sshd[12868]: Connection closed by 192.168.10.135 port 36168 [preauth]
[root@rhel77 ~]# 

-->CentOS7.9(ip:192.168.10.135)機(jī)器

Jun  9 10:16:58 centos79 polkitd[728]: Unregistered Authentication Agent for unix-process:5517:669130 (system bus name :1.203, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale zh_CN.UTF-8) (disconnected from bus)
Jun  9 10:17:33 centos79 sshd[5534]: Authentication refused: bad ownership or modes for directory /root
Jun  9 10:17:37 centos79 sshd[5534]: Connection closed by 192.168.10.110 port 38882 [preauth]
Jun  9 10:24:02 centos79 sshd[5599]: Authentication refused: bad ownership or modes for directory /root
Jun  9 10:24:03 centos79 sshd[5599]: Connection closed by 192.168.10.110 port 38884 [preauth]
[root@centos79 ~]# 

問題點(diǎn):

-->RHEL7.7(ip:192.168.10.110)機(jī)器

Jun ?9 10:24:34 rhel77 sshd[12868]: Authentication refused: bad ownership or modes for directory /root


-->CentOS7.9(ip:192.168.10.135)機(jī)器

Jun ?9 10:24:02 centos79 sshd[5599]: Authentication refused: bad ownership or modes for directory /root

通過google搜索排查定位,被告知:/root目錄權(quán)限過大(排查發(fā)現(xiàn)root目錄權(quán)限為777),最多(建議)設(shè)置為700權(quán)限

/root目錄權(quán)限

更改前:

-->RHEL7.7(ip:192.168.10.110)機(jī)器

[root@rhel77 ~]# cd /
[root@rhel77 /]# pwd
/
[root@rhel77 /]# ls -ld root
drwxrwxrwx. 17 root root 8192 Jun  9 08:33 root
[root@rhel77 /]# 

-->CentOS7.9(ip:192.168.10.135)機(jī)器

[root@centos79 ~]# cd /
[root@centos79 /]# pwd
/
[root@centos79 /]# ls -ld root
drwxrwxrwx. 25 root root 4096 6月   9 09:37 root
[root@centos79 /]# 

權(quán)限更改,更改后:

-->RHEL7.7(ip:192.168.10.110)機(jī)器

[root@rhel77 /]# pwd
/
[root@rhel77 /]# chmod 700 root/
[root@rhel77 /]# ls -ld root
drwx------. 17 root root 8192 Jun  9 08:33 root
[root@rhel77 /]# 

-->CentOS7.9(ip:192.168.10.135)機(jī)器

[root@centos79 /]# pwd
/
[root@centos79 /]# chmod 700 root
[root@centos79 /]# ls -ld root
drwx------. 25 root root 4096 6月   9 09:37 root
[root@centos79 /]# 

5.ssh互信登錄驗(yàn)證

-->RHEL7.7(ip:192.168.10.110)機(jī)器

[root@rhel77 /]# ssh 192.168.10.135
Last login: Fri Jun  9 09:55:34 2023 from rhel77

IPAddress: 	172.17.0.1
Memory Used: 	17.9%
Swap Used: 	0%
Disk Used: 	27%
Disk Size: 	38G
Services: 	46
系統(tǒng)內(nèi)核: 	3.10.0-1160.90.1.el7.x86_64
yum源已配置,能正常使用
[root@centos79 ~]# hostname
centos79
[root@centos79 ~]# exit
logout
Connection to 192.168.10.135 closed.
[root@rhel77 /]# 

-->CentOS7.9(ip:192.168.10.135)機(jī)器

[root@centos79 ~]# ssh 192.168.10.110
Last login: Fri Jun  9 10:33:32 2023 from gateway

IPAddress: 	192.168.10.110
Cpu Used: 	1.00%
Memory Used: 	5.3%
Swap Used: 	0%
Disk Used: 	8%
Disk Size: 	69G
Services: 	40
system core: 	3.10.0-1062.el7.x86_64
yum already installation
[root@rhel77 ~]# hostname
rhel77
[root@rhel77 ~]# exit
登出
Connection to 192.168.10.110 closed.
[root@centos79 ~]# 

至此,問題解決。

四.總結(jié)梳理

Linux服務(wù)器之前進(jìn)行ssh互信免密登錄時,文件及目錄的權(quán)限有嚴(yán)格控制,不能過渡授權(quán),主要點(diǎn):

1./root目錄權(quán)限為:700

2..ssh目錄權(quán)限為:700

3.文件權(quán)限(id_rsa,id_rsa.pug,authorized_keys,known_hosts):

-->id_rsa:私鑰,相當(dāng)于"鎖"。文件權(quán)限:600,不能更改。

-->id_rsa.pub:公鑰,相當(dāng)于"鑰匙"。文件權(quán)限:644,不能更改。

-->authorized_keys:認(rèn)證文件,記錄"別人"(即:對端)給你的公鑰“鑰匙”。文件權(quán)限:600,不能更改。

-->known_hosts:“指紋”文件,記錄首次SSH互信認(rèn)證"別人"(即:對端)留給你的“指紋”信息。文件權(quán)限:600,不能更改。

4.養(yǎng)成看ssh服務(wù)日志/var/log/secure的習(xí)慣

以上是我的一次真實(shí)的Linux服務(wù)器配置SSH免密碼登錄后,登錄仍提示輸入密碼的問題排查解決記錄。希望各位有所幫助。

創(chuàng)作不易,如果對你有所幫助或喜歡,請一鍵三連!

謝謝!文章來源地址http://www.zghlxwxcb.cn/news/detail-697781.html

到了這里,關(guān)于Linux服務(wù)器配置SSH免密碼登錄后,登錄仍提示輸入密碼(一次真實(shí)的問題排查解決記錄)的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • 輸入正確但提示ssh服務(wù)器拒絕了該密碼

    輸入正確但提示ssh服務(wù)器拒絕了該密碼

    通過mobaxterm輸入正確密碼但無法登錄情況 以及Xshell顯示拒絕了該密碼 ? ? 若出現(xiàn)能夠ping通,且sshd服務(wù)正常運(yùn)行,防火墻,selinux設(shè)置無誤但無法訪問的情況則需要檢查該配置文件并查看以下參數(shù)(大小寫無誤) sshd 配置文件為/etc/ssh/sshd_config AllowUsers AllowGroups DenyUsers DenyGro

    2024年02月15日
    瀏覽(26)
  • 簡單幾步學(xué)會Linux用戶使用SSH遠(yuǎn)程免密登錄,LinuxSSH服務(wù)器配置允許/禁止某些用戶遠(yuǎn)程登錄

    簡單幾步學(xué)會Linux用戶使用SSH遠(yuǎn)程免密登錄,LinuxSSH服務(wù)器配置允許/禁止某些用戶遠(yuǎn)程登錄

    本文基于Linux上CentOS 7版本配合Xshell 7進(jìn)行演示 目錄 一.SSH簡介 1.介紹 2.工作流程 二.具體配置免密步驟 1.配置前準(zhǔn)備工作 2.正式配置過程 三.在服務(wù)器端配置SSH遠(yuǎn)程黑白名單 1.配置文件/etc/ssh/sshd_config部分參數(shù)解析 2.配置遠(yuǎn)程登錄黑白名單 SSH用于計(jì)算機(jī)之間的加密登錄,是一類

    2024年02月22日
    瀏覽(28)
  • vscode SSH 保存密碼自動登錄服務(wù)器vs code

    vscode SSH 保存密碼自動登錄服務(wù)器vs code

    先在win local /mac 上拿到公鑰和私鑰,然后再把這公鑰copy 進(jìn)服務(wù)器。讓ssh 身份認(rèn)證轉(zhuǎn)化為秘鑰認(rèn)證 (mac也是一樣的) 第一步是在客戶端機(jī)器(通常是您的計(jì)算機(jī) win 10)上創(chuàng)建密鑰對:打開powershell, 輸入 默認(rèn)情況下ssh-keygen將創(chuàng)建一個 2048 位 RSA 密鑰對,這對于大多數(shù)用例來說

    2024年02月05日
    瀏覽(18)
  • vscode 配置ssh 免密登錄 多臺服務(wù)器

    vscode 配置ssh 免密登錄 多臺服務(wù)器

    Visual Studio Code - Code Editing. Redefined 之前一直用pycharm 但是好像社區(qū)免費(fèi)版本不能連接服務(wù)器,還要本地同步代碼,比較繁瑣,因此改用vscode。 添加后可以嘗試登錄,確認(rèn)下賬號密碼,vpn是否正常 ssh name@ip -22 輸入密碼即可 win+r 打開運(yùn)行 cmd 彈出terminal ssh-keygen 三次回車 默認(rèn)地

    2024年02月17日
    瀏覽(24)
  • VSCode配置SSH遠(yuǎn)程免密登錄服務(wù)器

    VSCode配置SSH遠(yuǎn)程免密登錄服務(wù)器

    VScode遠(yuǎn)程開發(fā)時,每次都需要輸入密碼,其實(shí)同理可以和其他應(yīng)用類似配置免密登錄,流程也類似。 1.在本地主機(jī)生成公鑰和秘鑰 ? ? ? ? ssh-keygen 2.將公鑰內(nèi)容添加至服務(wù)器 ? ? ? ? 將生成鑰對時會給出其保存路徑,找到公鑰,復(fù)制內(nèi)容,添加到如下文件。 ????????s

    2024年02月13日
    瀏覽(22)
  • 阿里云服務(wù)器環(huán)境配置,ssh免密登錄和配置docker

    此文章適合ubuntu20.04 64位和ubuntu22.04 64位版本 一.登陸服務(wù)器 租完服務(wù)器后,首選需要使用本地gitbash或者cmd進(jìn)入服務(wù)器, 命令: ssh root@xxx?? xxx為服務(wù)器公網(wǎng)ip,然后yes,然后輸入密碼就會進(jìn)入自己的服務(wù)器, 二.創(chuàng)建用戶 阿里云服務(wù)器默認(rèn)權(quán)限是root用戶,權(quán)限太高,所以需

    2024年02月04日
    瀏覽(19)
  • CentOS Linux服務(wù)器無法遠(yuǎn)程 SSH 登錄故障處理

    在管理 CentOS Linux 服務(wù)器時,遠(yuǎn)程 SSH 登錄是一項(xiàng)關(guān)鍵功能。然而,有時候你可能會遇到無法通過 SSH 遠(yuǎn)程登錄到服務(wù)器的問題。這篇文章將為你提供一些故障處理的步驟,幫助你解決這個問題。 以下是一些可能導(dǎo)致無法遠(yuǎn)程 SSH 登錄的常見問題和相應(yīng)的解決方法: 確認(rèn) SSH 服

    2024年02月05日
    瀏覽(34)
  • (Windows )本地連接遠(yuǎn)程服務(wù)器(Linux),免密碼登錄設(shè)置

    (Windows )本地連接遠(yuǎn)程服務(wù)器(Linux),免密碼登錄設(shè)置

    在使用VScode連接遠(yuǎn)程服務(wù)器時,每次打開都要輸入密碼,以及使用ssh登錄或其它方法登錄,都要本地輸入密碼,這大大降低了使用感受,下面總結(jié)了免密碼登錄的方法,用起來巴適得很,起飛。 本地必須在PowerShell終端操控,如下: 打開終端后在終端輸入以下命令: 回車再回

    2024年02月11日
    瀏覽(30)
  • Windows服務(wù)器管理技巧:多用戶登錄設(shè)置、開啟防火墻與SSH遠(yuǎn)程登錄配置指南

    Windows服務(wù)器管理技巧:多用戶登錄設(shè)置、開啟防火墻與SSH遠(yuǎn)程登錄配置指南

    WindowsServer服務(wù)器管理技巧:對于使用WindowsServer服務(wù)器開發(fā)人員或者運(yùn)維人員初學(xué)者來說,可能會遇到很多問題,比如:如何設(shè)置允許多用戶同時登錄服務(wù)器?如何開啟服務(wù)器防火墻?Windows如何配置SSH遠(yuǎn)程登錄?等等,如果遇到了這些問題,來看看這篇文章就能解決啦! 如果

    2024年02月13日
    瀏覽(28)
  • 兩臺服務(wù)器上的兩個docker容器之間配置ssh免密登錄

    兩臺服務(wù)器上的兩個docker容器之間配置ssh免密登錄

    因?yàn)橐趦膳_服務(wù)器的容器上使用ucx實(shí)現(xiàn)GPU的RDMA,所以需要兩個容器之間ssh免密登錄 步驟如下(所有步驟均在容器內(nèi)部進(jìn)行) 切換成root用戶 在容器內(nèi)部安裝openssh: # apt-get install openssh-client openssh-server 編輯ssh的配置文件,更改ssh的端口: # vim /etc/ssh/sshd_config 在最后一行加

    2024年03月13日
    瀏覽(21)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包