TShopping

標題: CPanel登入SSH無法切換root及can not ssh: Permission denied 問題 [打印本頁]

作者: woff    時間: 2012-7-15 11:12
標題: CPanel登入SSH無法切換root及can not ssh: Permission denied 問題
由於剛換CPanel代管軟體

不熟悉操作方式,開啟root登入SSH太過容易被入侵

所以不允許SSH從ROOT身分登入才會安全

但是用USER登入過後

會無法 su -l
會顯示權限被拒絕
  1. su -
  2. -bash: /bin/su: Permission denied
複製代碼
  1. ls -la /bin/su
  2. -rwsr-x--- 1 root wheel 23960 Jun  3 04:31 /bin/su*
複製代碼

於是我發現su被列入"wheel" group



那就到後台CPANEL

Main >> Security Center >> Manage Wheel Group Users

add group 即可



用遠端SSH無法登入

can not ssh: Permission denied 是設定到DSA-KEY
vi /etc/ssh/sshd_config

  1. PasswordAuthentication no from yes
複製代碼

就可以了

CentOS 7 要另外設定
檢查 /etc/ssh/sshd_config


  1. cat /etc/ssh/sshd_config | grep PermitRootLogin
複製代碼


必須是 yes

作者: woff    時間: 2012-10-24 03:19
我有實體主機也有VPS




歡迎光臨 TShopping (http://www.tshopping.com.tw/) Powered by Discuz! X3.2