看過(guò)linux相關(guān)資料里面,都是警告不要用root帳號(hào)做操作。自己程序搭建過(guò)很多服務(wù)器,有的也是比著資料建用戶體系。比如,安裝mysql的時(shí)候,新建一個(gè)mysql的用戶,用戶組,然后用這個(gè)用戶操作安裝mysql,新建nginx的時(shí)候,同樣的。。
但是,還有很多時(shí)候,為了方便拿著root就搞起了。
請(qǐng)問(wèn),在linux做用戶操作權(quán)限的基本套路是什么?假設(shè)服務(wù)器有少數(shù)幾個(gè)人去操作,而且一般只是啟停類(lèi)的操作。并不會(huì)像大型項(xiàng)目那樣,有多個(gè)用戶同時(shí)的操作服務(wù)器。
認(rèn)證0級(jí)講師
For processes, the user who executes the process is usually created.
General companies just use sudo+audit, or small companies with dozens of servers can just use sudo.
Of course, it is recommended to do an audit.
There are not many people, so you can do audits through the recording function of bash.
For root operation, just set the startup user as a normal user! !
Large companies all use automated operation and maintenance, above the virtual layer + automated operation and maintenance tools!
A small company has dozens of servers with multiple operations and maintenance! Use a fortress machine! This is the so-called operation and maintenance audit!
Several people are doing start and stop operations, sudoer file restrictions!