expect
配合 console 作變化
自已作一個文檔
要改的時候就用貼的
#/.updat_root_passwd.exp Host user userpwd rootpwd newpwd
/script/updat_root_passwd.exp 192.168.1.1 c9992 pwd GOD dog
/script/updat_root_passwd.exp 192.168.1.2 c9992 pwd GOD dog
#!/usr/local/bin/expect
#scriptname : updat_root_passwd.exp
set HOSTNAME [lindex $argv 0]
set USERNAME [lindex $argv 1]
set USERPASSWD [lindex $argv 2]
set ROOTPASSWD [lindex $argv 3]
set NEWROOTPASSWD [lindex $argv 4]
spawn ssh $USERNAME@$HOSTNAME
expect "*assword:*"
send "$USERPASSWD\r"
expect "*>*"
send "su \r"
expect "*assword:*"
send "$ROOTPASSWD\r"
expect "*#*"
send "passwd root\r"
expect "*assword:*"
send "$NEWROOTPASSWD\r"
expect "*assword:*"
send "$NEWROOTPASSWD\r"
expect "*passwd: password successfully changed for root*"
exit
2008年10月23日 星期四
2007年12月15日 星期六
solaris 上網相關
solaris 上網相關
1. /etc/hosts or /etc/inet/hosts hosts file
2. /etc/resolv.conf DNS 解析
3. /etc/nsswitch.conf 名稱conf檔
4. /etc/defaultrouter defaultroute
1 hosts 檔案
bash-2.05# cat /etc/hosts#
# Internet host table
#
# ip hostname
127.0.0.1 localhost
10.10.10.240 testVM
10.10.10.10 router
2 resolv.conf
bash-2.05# cat /etc/resolv.conf#DNS 解析
nameserver 168.95.1.1
nameserver 10.10.10.10
3 /etc/nsswitch.conf
bash-2.05# grep hosts /etc/nsswitch.conf# "hosts:" and "services:" in this file are used only if the
hosts: files dns
4 /etc/defaultrouter
default gatewaybash-2.05# cat /etc/defaultrouter
10.10.10.10
cat /etc/hosts
cat /etc/resolv.conf
grep hosts /etc/nsswitch.conf
cat /etc/defaultrouter
訂閱:
文章 (Atom)
RHEL install EPEL
https://www.linuxtechi.com/install-epel-repo-on-rhel-system/ EPEL dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest...
-
https://www.linuxtechi.com/install-epel-repo-on-rhel-system/ EPEL dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest...
-
023_DG_3_restore 4.7 restore database on standby 4.7.1 startup nomount on standby STAGE [oracle@ Standby rmanbackup]$ export ORACL...
-
旋轉泡泡: Oracle DataGuard 相關 Oracle DataGuard 檢查開啟狀態 -- 請全貼 -- ===check=== select dbid,name from v$database; select log_mode , OPE...