簡體   English   中英

無法使用root用戶連接到Jenkins從站

[英]Cannot Connect to Jenkins Slave using root user

我在Windows服務器中有一個Jenkins主服務器,並使用TFS作為源代碼管理。 我從Jenkins主服務器連接了幾個Windows從服務器和一個Linux從服務器。 當我嘗試使用“ root用戶”使用“通過SSH在Unix計算機上啟動從屬代理”來配置Linux從屬時,它會因拋出以下錯誤而無法連接。

[SSH] Opening SSH connection to xxxxxx.
ERROR: Failed to authenticate as root. Wrong password. (credentialId:98262412-0d53-4f25-92de-beaa8458f459/method:password)
[08/21/15 04:01:43] [SSH] Authentication failed.
hudson.AbortException: Authentication failed.
    at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:1178)
    at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:701)
    at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:696)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
[08/21/15 04:01:43] Launch failed - cleaning up connection
[08/21/15 04:01:43] [SSH] Connection closed.

密碼是正確的,因為我可以使用與root用戶相同的密碼手動登錄從服務器。 因此,我嘗試創建另一個名為“奴隸”的用戶。

現在,Jenkins能夠使用用戶slave連接到slave服務器。 但是在執行作業時,我正在運行一個shell腳本,該腳本用於手動運行,但出於CI的考慮,它應該從Jenkins運行,該腳本具有一些chown命令,但都失敗了,並顯示“ Permission被拒絕”錯誤,這很明顯,因為我假設root用戶只能運行chown命令。

所以我用slave:x:0:0 ::編輯了/ etc / passwd來擁有root權限。 但是知道該工作因錯誤而失敗

Error: You must accept the End User License Agreement for this product
Run 'tf eula' to accept the End User License Agreement.
FATAL: Executable returned an unexpected result code [100]
ERROR: null

我已經接受了奴隸用戶以及root用戶的用戶協議,但仍然收到此錯誤。

如果我回滾/ etc / passwd腳本以從用戶身份運行,則此錯誤消失了,但再次無法運行chown命令。

任何解決此問題的幫助將不勝感激,我可以使用root用戶連接到slave,或者slave用戶應執行chown命令。

您有兩個選擇,要么必須啟用root ssh訪問(不建議),要么將您的“從屬”用戶添加到sudoers組並使用sudo運行chown命令(例如: sudo chown /path/to/file.txt )。

1)要啟用root ssh訪問,請編輯/etc/ssh/sshd_config ,並注釋掉以下行:

PermitRootLogin without-password

在它的下面,添加以下行:

PermitRootLogin yes

然后重新啟動SSH: service ssh restart

2)要將用戶添加到sudoers組,請按照以下鏈接中的說明進行操作: https : //access.redhat.com/documentation/zh-CN/Red_Hat_Enterprise_Linux_OpenStack_Platform/2/html/Getting_Started_Guide/ch02s03.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM