在虛擬機器 vagrantfile 的目錄位置 開啟控制台,輸入
檢視 hostname ,port,identityfile 這三個位置,登入資訊約為 127.0.0.1:2222,使用者名稱:vagrant$ vagrant ssh-config
host k8s-m1
hostname 127.0
.0.1
user vagrant
port 2222
userknownhostsfile /dev/
null
stricthostkeychecking no
passwordauthentication no
identityfile d
:/vagrant-file/file1/
.vagrant/machines/k8s-m1/virtualbox/private_key
identitiesonly yes
loglevel fatal
host k8s-n2
hostname 127.0
.0.1
user vagrant
port 2200
userknownhostsfile /dev/
null
stricthostkeychecking no
passwordauthentication no
identityfile d
:/vagrant-file/file1/
.vagrant/machines/k8s-n2/virtualbox/private_key
identitiesonly yes
loglevel fatal
有可能不能選擇密碼登入,預設是用金鑰登入,瀏覽,檔案,找到 剛剛的identityfile ,再輸入密碼vagrant 就可以使用vagrant 使用者 ssh登入
2.vagrant登陸後,切換到root賬號,設定root的密碼
修改 /etc/ssh/sshd_config 檔案,(注意,vagrant使用者下這個檔案是唯讀的,可能什麼也看不見)sudo -i
passwd
修改 ssd_config 裡 permitrootlogin屬性 改為yes ,並把前面的# 去掉
passwordauthentication 改為yes 並且去掉 #
儲存退出,重啟sshd服務
systemctl restart sshd
再通過xshell連線的時候,就可以用賬號密碼,root來登入了
問題:雖然xshell裡都是用127.0.0.1:2222或者2200 這種登入的,但是也可以使用自己設定的ip 例如192.16.25.11:22 去登入,這裡用自己設定的ip時埠則是22。
設定完成以後就和自己開的虛擬機器沒什麼兩樣了。
GitHub Git 切換使用者
windows 直接上控制面板,賬號管理,網路證書,把github的證書刪掉 接下來push 會直接彈出登入視窗。windows不需要要設定什麼亂七八糟的以下內容 git config global user.name your username git config global user.ema...
linux centos 使用者管理 切換使用者
組管理使用者,用家目錄規定,某個使用者可以在某個目錄下使用。cd home 切換到 home資料夾下。useradd xm 新增使用者 mkdir tiger 建立乙個叫tiger的資料夾。useradd d home tiger xh 在home的指定資料夾下建立使用者。passwd xh 對使用...
切換使用者命令 su sudo
使用root使用者登入可能會由於人為的誤操作導致資料丟失。通用做法是使用普通使用者登入並使用系統,當需要執行管理操作時,再切換到root使用者執行管理操作。臨時切換使用者命令su su root password 普通使用者切換到root使用者時,需要輸入root使用者密碼 root使用者切換到普通...