目标服务器上的 /etc 下的 passwd、shadow、group、gshadow 被设置了特殊属性 "i",没法使用 useradd 添加用户segmentfault
//0.查看被锁的特殊属性 [root@localhost ~]# lsattr /etc/passwd [root@localhost ~]# lsattr /etc/shadow [root@localhost ~]# lsattr /etc/group [root@localhost ~]# lsattr /etc/gshadow //1.去除特殊属性 [root@localhost ~]# chattr -i /etc/passwd [root@localhost ~]# chattr -i /etc/shadow [root@localhost ~]# chattr -i /etc/group [root@localhost ~]# chattr -i /etc/gshadow //2.添加用户、密码并加入组 [root@localhost ~]# useradd [username] [root@localhost ~]# passwd [username] [root@localhost ~]# useradd -g [groupname] [username] //恢复文件特殊属性 [root@localhost ~]# chattr +i /etc/gshadow [root@localhost ~]# chattr +i /etc/shadow [root@localhost ~]# chattr +i /etc/group [root@localhost ~]# chattr +i /etc/gshadow
#Phpstorm添加服务器时能够选择多种类型链接服务器 FTP - 使用FTP 链接到服务器。 FTPS - 使用FTPS 链接到服务器。 SFTP - 使用SFTP 链接到服务器。 In place - 搭建在本地的服务器 Local or mounted folder - 能够经过本地访问也可使用浏览器远程访问
使用 SFTP 方式添加远程服务器浏览器
测试链接后选取项目目录 服务器
点击文件或目录对线上代码进行比对、恢复或使用 Ctrl + S 上传到线上 工具