redhat雜記

一、設置sudo權限:修改/etc/sudoers文件,找到root    ALL=(ALL)       ALL,在後面添加nginx ALL=(ALL) NOPASSWD: ALLnginx

二、用sed命令在文件末尾添加一行:sudo sed -i '$a\nginx ALL=(ALL) NOPASSWD: ALL' /etc/sudoerstomcat

三、檢測端口是否能夠連通(不用telnet命令):nc -z -w 1 ip port服務器

四、查看端口:netstat –apnssh

五、看進程:ps -aux | grep tomcatrest

六、修改用戶所屬組(將nginx用戶納入root組):usermod -g root nginx進程

七、ssh免密登陸:首先客戶端要有私/公鑰(能夠經過ssh-keygen -t rsa生成到~/.ssh),而後把公鑰傳送到服務器(ssh-copy-id userb@ServerIP或者ssh-copy-id -i ~/.ssh/id_rsa.pub userb@ServerIP),期間須要輸入userb在服務器上的密碼。ip

八、修改iptablse設置:修改配置文件:/etc/sysconfig/iptables,再service iptables restarttable

相關文章
相關標籤/搜索
本站公眾號
   歡迎關注本站公眾號,獲取更多信息