溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

【ERROR】su user報(bào)'This account is currently not available'錯(cuò)誤 for linux

發(fā)布時(shí)間:2020-08-05 03:51:52 來(lái)源:ITPUB博客 閱讀:393 作者:達(dá)芬奇的夢(mèng) 欄目:建站服務(wù)器

 

問(wèn)題描述:

Linux 操作系統(tǒng)連接用戶時(shí)報(bào)錯(cuò):【This account is currently not available.】

 

[root@sam ~]# su - mysql

This account is currently not available.

 

問(wèn)題分析:

查看賬號(hào)(用戶)信息

使用Vipw mysql命令或 cat /etc/passwd文件

 

發(fā)現(xiàn)mysql用戶后為‘/sbin/nologin’,需要修改為‘/bin/bash’后方可連接使用。

[root@sam ~]# cat /etc/passwd

root:x:0:0:root:/root:/bin/bash

……

mysql:x:500:500::/home/mysql:/sbin/nologin

 

處理方法:

  1. 直接命令試:

usermod -s /bin/bash mysql

 

  1. 修改‘/etc/passwd’文件:

修改前:

mysql:x:500:500::/home/mysql:/sbin/nologin

修改后:

mysql:x:500:500::/home/mysql:/bin/bash

 

Repaired驗(yàn)證:

[root@sam ~]# cat /etc/passwd

root:x:0:0:root:/root:/bin/bash

……

mysql:x:500:500::/home/mysql:/bin/bash

 

[root@sam ~]# su - mysql

[mysql@sam ~]$ id

uid=500(mysql) gid=500(mysql) groups=500(mysql)

 

總結(jié):修改前要記錄相關(guān)信息,以便回退使用。

 

 

 

 

 

 

 

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI