ssh秘钥分发useradd linuxea
[linuxea@NFS-server ~]$ useradd linuxea
[linuxea@NFS-server ~]$ echo 123|passwd --stdin linuxea
实现本地登录远程免秘钥
[linuxea@NFS-server ~]$ ssh-copy-id -i .ssh/id_dsa.pub linuxea@10.0.0.55
实现本地用户让远程用户免密码登录!
[linuxea@NFS-server ~]$ scp -p .ssh/id_dsa linuxea@10.0.0.53:~/.ssh
[linuxea@NFS-server ~]$ ssh-copy-id -i .ssh/id_dsa.pub linuxea@10.0.0.52
发邮件
[root@NFS-server ~]# /etc/init.d/postfix restart
Shutting down postfix: [ OK ]
Starting postfix: [ OK ]
[root@NFS-server ~]# su - linuxea^C
[root@NFS-server ~]# lsof -i :25
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
master 5223 root 12u IPv4 45229 0t0 TCP localhost:smtp (LISTEN)
master 5223 root 13u IPv6 45231 0t0 TCP localhost:smtp (LISTEN)
[root@NFS-server ~]# mail -s "linuxea title" 734943463@qq.com </etc/hosts
[root@NFS-server ~]# mailq
Mail queue is empty
[root@NFS-server ~]#
![1.png][1]
if [ -s "/var/log/backupSQLfile.log" ]
then
mail -s "$(date +%F-%T) backup" 734943463@qq.com <</var/log/backSQLfail.log
>/var/log/backSQLfile.log
fi
163:
[root@NFS-server ~]# vim /etc/mail.rc
#######set mail
set from=usertzc@163.com smtp=smtp.163.com
set smtp-auth-user=usertzc smtp-auth-password=password smtp-auth=login
[root@NFS-server ~]# mail -s linuxea 734943463@qq.com < /etc/rc.local