在root用户下
#!/bin/bash
tar -zxvf jdk*
cd jdk1*
home=`pwd`
echo $home
echo "export JAVA_HOME=${home}" >> /etc/profile
echo "export CLASSPATH=\$JAVA_HOME/lib" >> /etc/profile
echo "export PATH=\$PATH:\$JAVA_HOME/bin" >> /etc/profile
source /etc/profile
在普通用户下
1.登录root创建普通用户并修改参数
#!/bin/bash
user=haha
groupadd ${user}
useradd -g ${user} ${user} -m
passwd ${user}
chmod +w /etc/sudoers
echo "${user} ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers
chmod -w /etc/sudoers
echo "* soft noproc 65535" >> /etc/security/limits.conf
echo "* hard noproc 65535" >> /etc/security/limits.conf
echo "* soft nofile 1000000" >> /etc/security/limits.conf
echo "* hard nofile 1000000" >> /etc/security/limits.conf
echo "sysctl -w fs.file-max =65536" &g