if [ ! $# -eq 2 ] ;then
echo "请输入用户密码以空格分开"
exit
else
ssh-keygen -t rsa
#用户名
uname="$1"
#密码
passwd="$2"
fi
#执行检测并安装expect模块
ep=`rpm -qa | grep expect`
if [ -z $ep ] ; then
echo "检测到你的系统,没有安装e...
分类:
其他好文 时间:
2016-05-07 07:59:53
阅读次数:
139
dr-mysql01:/root# cat a1.sh
#用户名
uname="$1"
#密码
passwd="$2"
#执行检测并安装expect模块
ep=`rpm -qa | grep expect`
if [ -z $ep ] ; then
echo "检测到你的系统,没有安装expect模块,准备执行安装"
sleep 2
yum install -y expect
...
分类:
其他好文 时间:
2016-05-07 07:59:36
阅读次数:
138
##/bin/bashpassword=‘Aa123456‘foruserin$(cat./user_id)do/usr/bin/expect<<Eofsettimeout10expect"*#"spawn/usr/sbin/useradd${user}expect"*#"spawn/usr/bin/passwd${user}expect{"*password:"{send"$password\r";exp_continue}"*password:"{send"$password\r"}}Eofdone
分类:
其他好文 时间:
2016-05-07 01:17:42
阅读次数:
178
#!/usr/bin/expectset user [lindex $argv 0]set pass [lindex $argv 1]spawn useradd -s /bin/sh -d /home/$user $userexpect "*#"spawn passwd $userexpect "* ...
分类:
其他好文 时间:
2016-05-05 17:40:54
阅读次数:
127
问题一,创建新用户xuetong,用该用户登陆报错如下:[root@R715~]#su-xuetongid:cannotfindnameforuserID504id:cannotfindnameforgroupID504id:cannotfindnameforuserID504[Ihavenoname!@R715~]$并且显示Ihavenoname!解决:由于/etc/passwd和/etc/group两个文件的权限(600)不..
分类:
系统相关 时间:
2016-05-05 13:06:50
阅读次数:
281
今天没事,做了个小实验,普通用户切换如何省略密码省略密码验证(下面是那个具体的实验内容)很简单,只需把/etc/passwd中的root:x:0:0:root:/root:/bin/bash,改为root::0:0:root:/root:/bin/bash,就可以了,就是去掉了里面的x,这样root用户就不用密码了。其他用户也一样。..
分类:
其他好文 时间:
2016-05-05 11:12:10
阅读次数:
158
一定时任务foruserin$(cat/etc/passwd|cut-f1-d:);docrontab-l-u$user;done是否有用户执行了隐藏定时任务?是否有某个任务正在备份二网络sysctl-a|grepxx查看网络内核参数信息ss-s显示所有存在的连接cat/proc/interrupts查看中断请求是否均匀分给cpu处理,还是会有某个CPU的核..
分类:
系统相关 时间:
2016-05-05 07:14:02
阅读次数:
237
1)安装好ubuntu后输入如下命令来获得root权限: sudo passwd 2)ubuntu下源的更改: sudo gedit /etc/apt/sources.list 找到一个还用的源替换掉 /etc/apt/sources.list中原来的内容 执行更新: sudo apt-get up ...
分类:
系统相关 时间:
2016-05-05 00:14:20
阅读次数:
247
1,账户管理:账户的添加:添加用户名,设置密码(useradd,passwd);添加组(groupadd);将某用户加入某组(usermod-G);创建用户,并指定主目录(useradd-d)将某用户同时添加到两个组(usermod-Ggroup1,group2user);查看某用户属于某组(groups);查看group、passwd、shadow、..
分类:
系统相关 时间:
2016-05-04 19:15:20
阅读次数:
144
其实ubuntu在安装时已经添加了root用户,只是屏蔽了。所以只需要激活即可。打开终端ctrl+alt+t,输入sudo passwd root,然后输入要添加给root的密码。 sudo apt-get install nautilus-open-terminal 此时再单击右键就会出现open ...
分类:
系统相关 时间:
2016-05-03 23:29:39
阅读次数:
242