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

Linux學(xué)習(xí)筆記-Ubuntu系統(tǒng)下配置ssh免密訪問,創(chuàng)建多用戶免密訪問

這篇具有很好參考價(jià)值的文章主要介紹了Linux學(xué)習(xí)筆記-Ubuntu系統(tǒng)下配置ssh免密訪問,創(chuàng)建多用戶免密訪問。希望對大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

一、基本信息

Ubuntu是linux系統(tǒng),雖然他是支持界面化操作的,一般用來做服務(wù)器用,所以配置ssh可以比較安全的進(jìn)行訪問,也方便在其他地方訪問服務(wù)器,輕松省事。
Ubuntu系統(tǒng)版本:
使用uname -a指令獲取系統(tǒng)版本信息

zero@ubuntu:~$ uname -a
Linux ubuntu 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

具體信息如下:

  • 系統(tǒng)類型: Linux
  • 主機(jī)名:ubuntu
  • 內(nèi)核版本:5.15.0-79-generic
  • 編譯時(shí)間:#86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023
  • 硬件架構(gòu):x86_64 x86_64 x86_64(處理器架構(gòu),操作系統(tǒng)類型,軟件環(huán)境)
  • 操作系統(tǒng)名稱:GNU/Linux

二、ssh安裝

2.1 查看是否已經(jīng)安裝ssh

直接輸入ssh查看

zero@ubuntu:~$ ssh
usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface]
           [-b bind_address] [-c cipher_spec] [-D [bind_address:]port]
           [-E log_file] [-e escape_char] [-F configfile] [-I pkcs11]
           [-i identity_file] [-J [user@]host[:port]] [-L address]
           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
           [-Q query_option] [-R address] [-S ctl_path] [-W host:port]
           [-w local_tun[:remote_tun]] destination [command [argument ...]]

有具體的信息就是已經(jīng)安裝了。

2.2 安裝ssh

可以使用如下指令安裝ssh

sudo apt-get install openssh-server

一般服務(wù)器是被訪問的,所以只要安裝openssh-server即可,如果要安裝客戶端,將安裝的內(nèi)容改成openssh-client即可。

2.3 查看ssh安裝狀態(tài)

安裝完成后重新查看ssh安裝狀態(tài)
使用netstat查看狀態(tài)

zero@ubuntu:~$ sudo netstat -tlnp | grep sshd
[sudo] password for zero:
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2714/sshd: /usr/sbi
tcp6       0      0 :::22                   :::*                    LISTEN      2714/sshd: /usr/sbi

使用systemctl查看狀態(tài)

zero@ubuntu:~$ sudo systemctl status ssh
● ssh.service - OpenBSD Secure Shell server
     Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2023-08-26 15:01:13 UTC; 13min ago
       Docs: man:sshd(8)
             man:sshd_config(5)
   Main PID: 2714 (sshd)
      Tasks: 1 (limit: 4514)
     Memory: 4.0M
        CPU: 33ms
     CGroup: /system.slice/ssh.service
             └─2714 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups"

Aug 26 15:01:13 ubuntu systemd[1]: Starting OpenBSD Secure Shell server...
Aug 26 15:01:13 ubuntu sshd[2714]: Server listening on 0.0.0.0 port 22.
Aug 26 15:01:13 ubuntu sshd[2714]: Server listening on :: port 22.
Aug 26 15:01:13 ubuntu systemd[1]: Started OpenBSD Secure Shell server.
Aug 26 15:11:26 ubuntu sshd[2899]: Accepted password for zero from 192.168.159.1 port 51604 ssh2
Aug 26 15:11:26 ubuntu sshd[2899]: pam_unix(sshd:session): session opened for user zero(uid=1000) by (uid=0)

三、啟動(dòng)、停止,及開機(jī)自啟動(dòng)

3.1 啟動(dòng)ssh

zero@ubuntu:~$ sudo systemctl start ssh		#啟動(dòng)ssh服務(wù)
zero@ubuntu:~$ sudo systemctl status sshd	#查詢狀態(tài)
Unit sshd.service could not be found.
zero@ubuntu:~$ sudo systemctl status ssh
● ssh.service - OpenBSD Secure Shell server
     Loaded: loaded (/lib/systemd/system/ssh.service; disabled; vendor preset: enabled)
     Active: active (running) since Sat 2023-08-26 15:01:13 UTC; 27min ago
       Docs: man:sshd(8)
             man:sshd_config(5)
   Main PID: 2714 (sshd)
      Tasks: 1 (limit: 4514)
     Memory: 4.0M
        CPU: 33ms
     CGroup: /system.slice/ssh.service
             └─2714 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups"

Aug 26 15:01:13 ubuntu systemd[1]: Starting OpenBSD Secure Shell server...
Aug 26 15:01:13 ubuntu sshd[2714]: Server listening on 0.0.0.0 port 22.
Aug 26 15:01:13 ubuntu sshd[2714]: Server listening on :: port 22.
Aug 26 15:01:13 ubuntu systemd[1]: Started OpenBSD Secure Shell server.
Aug 26 15:11:26 ubuntu sshd[2899]: Accepted password for zero from 192.168.159.1 port 51604 ssh2
Aug 26 15:11:26 ubuntu sshd[2899]: pam_unix(sshd:session): session opened for user zero(uid=1000) by (uid=0)
zero@ubuntu:~$ sudo netstat -tlnp | grep sshd	#查詢狀態(tài)
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2714/sshd: /usr/sbi
tcp6       0      0 :::22                   :::*                    LISTEN      2714/sshd: /usr/sbi

3.2 關(guān)閉ssh

zero@ubuntu:~$ sudo systemctl stop ssh				#關(guān)閉ssh服務(wù)
zero@ubuntu:~$ sudo netstat -tlnp | grep sshd		#關(guān)閉后查詢不到網(wǎng)絡(luò)狀態(tài)
zero@ubuntu:~$ sudo systemctl status ssh			#ssh狀態(tài)已關(guān)閉
○ ssh.service - OpenBSD Secure Shell server
     Loaded: loaded (/lib/systemd/system/ssh.service; disabled; vendor preset: enabled)
     Active: inactive (dead) since Sat 2023-08-26 15:34:05 UTC; 11s ago
       Docs: man:sshd(8)
             man:sshd_config(5)
    Process: 2714 ExecStart=/usr/sbin/sshd -D $SSHD_OPTS (code=exited, status=0/SUCCESS)
   Main PID: 2714 (code=exited, status=0/SUCCESS)
        CPU: 35ms

Aug 26 15:01:13 ubuntu systemd[1]: Starting OpenBSD Secure Shell server...
Aug 26 15:01:13 ubuntu sshd[2714]: Server listening on 0.0.0.0 port 22.
Aug 26 15:01:13 ubuntu sshd[2714]: Server listening on :: port 22.
Aug 26 15:01:13 ubuntu systemd[1]: Started OpenBSD Secure Shell server.
Aug 26 15:11:26 ubuntu sshd[2899]: Accepted password for zero from 192.168.159.1 port 51604 ssh2
Aug 26 15:11:26 ubuntu sshd[2899]: pam_unix(sshd:session): session opened for user zero(uid=1000) by (uid=0)
Aug 26 15:34:05 ubuntu systemd[1]: Stopping OpenBSD Secure Shell server...
Aug 26 15:34:05 ubuntu systemd[1]: ssh.service: Deactivated successfully.
Aug 26 15:34:05 ubuntu systemd[1]: Stopped OpenBSD Secure Shell server.

3.3 使用systemctl設(shè)置ssh服務(wù)自啟動(dòng)

zero@ubuntu:~$ sudo systemctl enable ssh
Synchronizing state of ssh.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable ssh

ubuntu 免密登錄,# Ubuntu,linux,學(xué)習(xí),筆記,ubuntu,ssh

設(shè)置完成之后重啟即可

3.4 使用systemctl關(guān)閉ssh開機(jī)啟動(dòng)

zero@ubuntu:~$ sudo systemctl disable ssh
Synchronizing state of ssh.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install disable ssh
Removed /etc/systemd/system/multi-user.target.wants/ssh.service.
Removed /etc/systemd/system/sshd.service.

ubuntu 免密登錄,# Ubuntu,linux,學(xué)習(xí),筆記,ubuntu,ssh

四、配置通過密鑰進(jìn)行免密訪問

部分操作說明可參考Windows下配置SSH實(shí)現(xiàn)免密訪問和遠(yuǎn)程端口轉(zhuǎn)發(fā),本文直接進(jìn)行操作。

4.1 生成密鑰

zero@ubuntu:~$ sudo ssh-keygen			#此處直接使用默認(rèn)設(shè)置生成rsa的密鑰
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):	//不修改路徑
Enter passphrase (empty for no passphrase):			#不設(shè)置密碼,實(shí)際使用根據(jù)自己需要設(shè)置密碼會(huì)比較安全
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:elLfv9r5e4RLOSKnee6oJPBGmS6YGm3WcAuvXVAxBtg root@ubuntu
The key's randomart image is:
+---[RSA 3072]----+
|   o..+          |
|  . E. o         |
|      .          |
|     . o         |
|  o + + S      o |
| . O B o ...o = .|
|. * = O o .=.o + |
| = o + =  o..o...|
|. . .   ...++.=++|
+----[SHA256]-----+

注: 若要配置git訪問服務(wù)器,此處密鑰對可使用rsa格式的,git for windows默認(rèn)識(shí)別rsa密鑰。

4.2 通過ssh-agent管理私鑰

zero@ubuntu:~$ ssh-agent			#啟動(dòng)服務(wù)
SSH_AUTH_SOCK=/tmp/ssh-XXXXXXjkoDta/agent.3455; export SSH_AUTH_SOCK;
SSH_AGENT_PID=3456; export SSH_AGENT_PID;
echo Agent pid 3456;

zero@ubuntu:~$ ssh-add /root/.ssh/id_rsa	# 沒有使用agent啟動(dòng)bash直接調(diào)用ssh-add添加私鑰會(huì)報(bào)錯(cuò)
Could not open a connection to your authentication agent.	

zero@ubuntu:~$ sudo ssh-agent bash --login -i		# 使用ssh-agent啟動(dòng)bash,注意需要添加sudo,添加root的密鑰需要使用root權(quán)限。

root@ubuntu:/home/zero# ssh-add /root/.ssh/id_rsa		#將密鑰添加到agent中
Identity added: /root/.ssh/id_rsa (root@ubuntu)
root@ubuntu:/home/zero# exit		# 退出當(dāng)前bash
logout
zero@ubuntu:~$

ssh-add 參數(shù):

  • -D:刪除ssh-agent中的所有密鑰.
  • -d:從ssh-agent中刪除密鑰
  • -e pkcs11:刪除PKCS#11共享庫pkcs1提供的鑰匙。
  • -s pkcs11:添加PKCS#11共享庫pkcs1提供的鑰匙。
  • -L:顯示ssh-agent中的公鑰
  • -l:顯示ssh-agent中的密鑰
  • -t life:對加載的密鑰設(shè)置超時(shí)時(shí)間,超時(shí)ssh-agent將自動(dòng)卸載密鑰
  • -X:對ssh-agent進(jìn)行解鎖
  • -x:對ssh-agent進(jìn)行加鎖

4.3 管理公鑰

服務(wù)器管理公鑰,可以直接添加公鑰文件中

zero@ubuntu:~$ cat /root/.ssh/id_ras.pub >> authorized_keys			# 直接拷貝匯報(bào)錯(cuò),當(dāng)我們要操作的公鑰在root文件夾下時(shí)就需要root權(quán)限
cat: /root/.ssh/id_ras.pub: Permission denied

zero@ubuntu:~$ sudo cat /root/.ssh/id_rsa.pub >> authorized_keys			# 添加sudo使用root權(quán)限操作
zero@ubuntu:~$			# 操作成功沒有錯(cuò)誤提示

4.4 通過scp將公鑰拷貝到服務(wù)器

需要將公鑰拷貝到要訪問的服務(wù)器中。

PS C:\WINDOWS\system32> scp C:\Users\LJM\.ssh\id_rsa.pub zero@192.168.159.129:.ssh/id_rsa_git.pub
zero@192.168.159.129's password:
id_rsa.pub                                                                            100%  567   558.8KB/s   00:00
PS C:\WINDOWS\system32>

ubuntu 免密登錄,# Ubuntu,linux,學(xué)習(xí),筆記,ubuntu,ssh

4.5 將公鑰添加到公鑰管理文件中

切換到.ssh文件夾中,然后將公鑰添加到公鑰管理文件中。

zero@ubuntu:~/.ssh$ ll
total 24
drwx------ 2 zero zero 4096 Aug 26 17:25 ./
drwxr-x--- 4 zero zero 4096 Aug 26 16:13 ../
-rw------- 1 zero zero  567 Aug 26 17:28 authorized_keys
-rw-rw-r-- 1 zero zero 2602 Aug 26 16:57 id_rsa_git
-rw-rw-r-- 1 zero zero  567 Aug 26 17:25 id_rsa_git.pub
-rw-r--r-- 1 root root  565 Aug 26 16:43 id_rsa.pub
zero@ubuntu:~/.ssh$ cat id_rsa_git.pub >> authorized_keys

4.6 享受ssh免密鏈接服務(wù)器

公鑰和私鑰添加管理后,對應(yīng)的文件即可刪除了。然后客戶端就可以通過ssh免密訪問服務(wù)器。

通常一般要訪問的客戶端保存私鑰,服務(wù)端保存公鑰。

五、創(chuàng)建多用戶免密訪問

5.1 使用useradd創(chuàng)建新用戶

zero@ubuntu:~$ sudo useradd -g git git_user		# 創(chuàng)建用戶,并指定初始區(qū)組為git
zero@ubuntu:~$ id git_user						# 查詢用戶基本信息
uid=1001(git_user) gid=1001(git) groups=1001(git)

zero@ubuntu:/etc/ssh$ sudo passwd git_user		# 修改用戶密碼,不修改密碼,可能后續(xù)ssh無法登錄
New password:
Retype new password:
passwd: password updated successfully

5.2 將ssh的密鑰文件拷貝到新用戶的家目錄中

zero@ubuntu:~$ sudo cp .ssh/authorized_keys /home/git_user/.ssh/authorized_keys
  • 第一個(gè)目錄是已經(jīng)可以免密訪問的賬戶,家目錄下的密碼存儲(chǔ)文件,當(dāng)前就在zero賬戶的家目錄,故直接用相對路徑。
  • 第二個(gè)參數(shù)是新建用戶的家目錄下的.ssh文件,文件名保持一致,若修改文件名需要修改“/etc/ssh/sshd_config”文件的密碼保存文件,將新的文件名添加到后面。
    ubuntu 免密登錄,# Ubuntu,linux,學(xué)習(xí),筆記,ubuntu,ssh

5.3 將配置文件的擁有者修改為新建用戶和新建用戶的初始群組

zero@ubuntu:~$ cd /  # 返回更目錄

# 修改git_user的家目錄擁有著為git_user
zero@ubuntu:/$ sudo chown -R git_user /home/git_user/.ssh/authorized_keys
[sudo] password for zero:
zero@ubuntu:/$ getfacl /home/git_user/.ssh/authorized_keys
getfacl: Removing leading '/' from absolute path names
# file: /home/git_user/.ssh/authorized_keys
# owner: git_user
# group: root
user::rw-
group::---
other::---

# 修改/home/git_user的擁有群組為git
zero@ubuntu:/$ sudo chgrp git /home/git_user/.ssh/authorized_keys
zero@ubuntu:/$ getfacl /home/git_user/.ssh/authorized_keys
getfacl: Removing leading '/' from absolute path names
# file: /home/git_user/.ssh/authorized_keys
# owner: git_user
# group: git
user::rw-
group::---
other::---

由于原來拷貝的密鑰文件已經(jīng)存在密鑰,至此,有密鑰的電腦即可實(shí)現(xiàn)使用新賬號(hào)git_user進(jìn)行免密訪問了。

5.4 踩坑歷程:

在測試配置其他用戶也免密訪問的過程中通過多次實(shí)驗(yàn),首先在網(wǎng)上找解決方案,不過沒有找到,網(wǎng)上基本只是講了一個(gè)全新配置,沒有此方面的案例,迫不得已自行摸索。

  1. 最開始,我將創(chuàng)建萬用戶后,直接訪問,結(jié)果發(fā)現(xiàn)無法免密訪問。就想著新建用戶可能賬號(hào)是權(quán)限問題,所以就想著將新建戶和群組添加到ssh密鑰管理文件的權(quán)限里。
  2. 首先將用戶組添加到密鑰管理文件,結(jié)果不止新建用戶無法訪問,原來的zero賬戶也無法訪問了;
  3. 覺得可能是權(quán)限問題,所以又將該文件用戶的和其他用戶的權(quán)限改為“rw-”,也是一樣;
  4. 在常務(wù)無法使用之后,嘗試去除添加的新用戶git_user,仍然無法使用;
  5. 最后將該文件的group權(quán)限改為“—”才能正常訪問,即家目錄下ssh要正常訪問,authorized_keys的權(quán)限只能是擁有者,而且擁有群組的權(quán)限需要為“—”;
  6. 我又開始嘗試,新建一個(gè)用戶,然后將新建用戶家目錄和初始群組設(shè)置為可以免密訪問的用戶同目錄和群組,結(jié)果原來的用戶可以正常免密訪問,但是新用戶依然無法實(shí)現(xiàn)免密訪問;
  7. 嘗試將密鑰文件authorized_keys的權(quán)限添加上新用戶的,不過新用戶依然無法實(shí)現(xiàn)免密訪問。
  8. 最終,經(jīng)過多番折騰,發(fā)現(xiàn)只能通過新建用戶的家目錄中添加配置文件,然后再行添加密鑰即可實(shí)現(xiàn)免密訪問,才是應(yīng)該是家目錄的特殊性導(dǎo)致的,畢竟家目錄是針對單一用戶設(shè)置的,理論上每一個(gè)用戶都有一個(gè)家目錄。

踩踩坑,記錄以下。文章來源地址http://www.zghlxwxcb.cn/news/detail-754765.html

到了這里,關(guān)于Linux學(xué)習(xí)筆記-Ubuntu系統(tǒng)下配置ssh免密訪問,創(chuàng)建多用戶免密訪問的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲(chǔ)空間服務(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)文章

  • 作業(yè):通過兩臺(tái)linux主機(jī)配置ssh實(shí)現(xiàn)互相免密登陸

    作業(yè):通過兩臺(tái)linux主機(jī)配置ssh實(shí)現(xiàn)互相免密登陸

    做題步驟 : 一.開啟兩個(gè)Linux主機(jī),并且用ssh連接,要能夠ping通 我這里是server:192.168.81.129 client:192.168.81.130 舉例 操作如下: 二.在客戶端上創(chuàng)建一對密鑰 1. 注意:可以看到這對密鑰是放在/root/.ssh/id_rsa.pub文件下的,公鑰的名字是id_rsa.pub 2.查看一下密鑰對 [root@client ~]# ll

    2024年01月17日
    瀏覽(26)
  • 【Linux網(wǎng)絡(luò)】ssh服務(wù)與配置,實(shí)現(xiàn)安全的密鑰對免密登錄

    【Linux網(wǎng)絡(luò)】ssh服務(wù)與配置,實(shí)現(xiàn)安全的密鑰對免密登錄

    目錄 一、SSH基礎(chǔ) 1、什么是ssh服務(wù)器 2、對比一下ssh協(xié)議與telnet協(xié)議 3、常見的底層為ssh協(xié)議的軟件: 4、拓展 二、SSH軟件學(xué)習(xí) 1、ssh服務(wù)軟件學(xué)習(xí)? 2、sshd公鑰傳輸?shù)脑恚?3、ssh命令學(xué)習(xí): 4、學(xué)習(xí)解讀sshd服務(wù)配置文件: 三、ssh服務(wù)的應(yīng)用 1、使用密鑰對免密碼登錄 第一步

    2024年02月04日
    瀏覽(26)
  • Ubuntu免密ssh登錄阿里云

    要在Ubuntu上設(shè)置SSH免密登錄阿里云服務(wù)器,請按照以下步驟操作: 在本地Ubuntu計(jì)算機(jī)上,打開一個(gè)終端窗口。 檢查是否已經(jīng)有SSH密鑰對。輸入以下命令: 如果該命令返回了 id_rsa 和 id_rsa.pub 兩個(gè)文件,說明你已經(jīng)生成過SSH密鑰對,可以跳過下一步。 如果沒有SSH密鑰對,請生

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

    簡單幾步學(xué)會(huì)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)
  • ubuntu系統(tǒng)設(shè)置ssh遠(yuǎn)程訪問

    本文檔主要記錄Ubuntu系統(tǒng)安裝完成后,設(shè)置ssh遠(yuǎn)程訪問的過程。 Ubuntu 20.04

    2024年02月16日
    瀏覽(24)
  • 威聯(lián)通NAS VirtualizationStation 安裝ubuntu配置SSH遠(yuǎn)程訪問

    威聯(lián)通NAS VirtualizationStation 安裝ubuntu配置SSH遠(yuǎn)程訪問

    Ubuntu中國官網(wǎng) 大家可以選擇下載22.04LTS長期支持版,也可以選擇下載其他版本,比如20.04LTS或者16.04LTS。但版本越高對配置要求越高,建議配置在8GRAM及以上。 應(yīng)用商店下載VirtualizationStation 后啟動(dòng),并建立虛擬機(jī) 選擇嘗試安裝ubuntu 后續(xù)(我以中文版為例,建議英文版): 選

    2024年04月13日
    瀏覽(90)
  • SSH免密登錄配置

    SSH免密登錄配置

    免密登錄命令: 1.進(jìn)入.ssh目錄 :? cd ~/.ssh 2.生成一對密鑰:? ssh-keygen -t rsa 3.發(fā)送公鑰: ? ? ? ? ssh-copy-id 192.168.xx.xxx 4.免密登錄測試: ssh?192.168.xx.xxx 目錄 一、免密登錄原理 二、配置ssh 1.查看 .ssh目錄 2.進(jìn)入.ssh目錄 3.ssh連接102 4.生成密鑰 5.生成后文件介紹 6.cat查看id_rsa

    2024年02月03日
    瀏覽(15)
  • Linux系統(tǒng)配置sftp服務(wù)以及實(shí)現(xiàn)免密登錄

    網(wǎng)上的一系列部署總有問題,記錄下部署配置成功案例。 一、部署sftp服務(wù) (本質(zhì)是sftp服務(wù)使用ssh中的協(xié)議,默認(rèn)端口也跟隨ssh服務(wù)的配置) 1、創(chuàng)建用戶組: 2、創(chuàng)建用戶testsftp,并將用戶添加到剛創(chuàng)建的用戶組,拒絕用戶登錄shell 3、指定sftp的家目錄,自選人意位置,我這

    2024年02月16日
    瀏覽(17)
  • 樹莓派ubuntu:vscode remote-ssh免密登錄(Mac)

    Vscode remove-ssh遠(yuǎn)程開發(fā)很方便,但是每次登陸都會(huì)頻繁要求輸入密碼,使用期間也會(huì)多次斷開重連,提示再次輸入密碼。 可能因?yàn)槲议_發(fā)板的ubuntu系統(tǒng)用的后來創(chuàng)建的用戶的原因,按網(wǎng)上的文章始終無法實(shí)現(xiàn)免密登錄,多次嘗試后如下方式解決,整理如下: 1. 本地生成key 生

    2024年01月21日
    瀏覽(31)
  • VSCODE[配置ssh免密遠(yuǎn)程登錄]

    VSCODE[配置ssh免密遠(yuǎn)程登錄]

    本文摘錄于:https://blog.csdn.net/qq_44571245/article/details/123031276只是做學(xué)習(xí)備份之用,絕無抄襲之意,有疑惑請聯(lián)系本人! 這里要注意如下幾個(gè)地方: 1.要進(jìn)入.ssh目錄創(chuàng)建文件: 2.是拷貝帶\\\"ssh-rsa \\\"內(nèi)容的文件:

    2024年02月13日
    瀏覽(18)

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

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

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

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

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包