Oracle 9i
Log in as oracle
% sqlplus /nolog
SQL> conn / as sysdba
SQL> alter user system identified by new_password;
SQL> exit
Oracle 9i
Log in as oracle
% sqlplus /nolog
SQL> conn / as sysdba
SQL> alter user system identified by new_password;
SQL> exit
一台Dell D600笔记本,安装有RedHat AS 4。
原来的内存是512兆(两条256的),更换成1G(1条)后,重启机器,启用网卡时出现错误:Device eth0 has different MAC address than expected, ignoring. 系统启动以后找不到网卡设备。
google以后,在redhat的邮件列表里找到解决办法与大家分享。
https://www.redhat.com/archives/ ... -June/msg00407.html
先注释掉/etc/sysconfig/network-scripts/ifcfg-eth0中HWADDR=xx:xx:xx:xx:xx:xx这一行。在查看文件/etc/modprobe.conf,得知eth0的模块名tg3。用lsmod查看,没有发现tg3这个module。
执行如下命令:
# depmod -a
# modprobe -v tg3
然后,重启网络
# service network restart
问题解决。
这个是发在CU的旧帖,也是我最后一次接触Solaris(到目前为止)。
1. 下载软件包
先取得wget,方便其他软件包的下载
# ftp www.sunfreeware.com
ftp > cd pub/freeware/sparc/9
ftp > get wget-1.9.1-sol9-sparc-local.gz
ftp > bye
安装wget
# gunzip wget-1.9.1-sol9-sparc-local.gz
# pkgadd -d wget-1.9.1-sol9-sparc-local
下载vsftpd
# wget ftp://vsftpd.beasts.org/users/cevans/vsftpd-2.0.1.tar.gz
# gunzip vsftpd-2.0.1.tar.gz
# tar xvf vsftpd-2.0.1.tar
下载编译vsftpd必需的软件包
# wget ftp://ftp.sunfreeware.com/pub/freeware/sparc/9/make-3.80-sol9-sparc-local.gz
# gunzip make-3.80-sol9-sparc-local.gz
# pkgadd -d make-3.80-sol9-sparc-local
# wget ftp://mirror.sprintlink.net/sunfreeware.com/pub/freeware/sparc/9/libiconv-1.8-sol9-sparc-local.gz
# gunzip libiconv-1.8-sol9-sparc-local.gz
# pkgadd -d libiconv-1.8-sol9-sparc-local
# wget ftp://mirror.sprintlink.net/sunfreeware.com/pub/freeware/sparc/9/gcc_small-3.3.2-sol9-sparc-local.gz
# gunzip gcc_small-3.3.2-sol9-sparc-local.gz
# pkgadd -d gcc_small-3.3.2-sol9-sparc-local
2. 编译安装vsftpd
# cd vsftpd-2.0.1
# make
# mkdir /usr/share/empty
# cp vsftpd /usr/local/bin/vsftpd
# cp vsftpd.conf.5 /usr/local/man/man5
# cp vsftpd.8 /usr/local/man/man8
# cp vsftpd.conf /etc
3. 配置vsftpd
建ftp目录和ftp帐号,所有ftp登录用户都映射到此帐号
# mkdir /data/ftp
# groupadd ftp
# useradd -d /data/ftp -g ftp -s /bin/false ftp
# chown ftp:ftp /data/ftp
# echo "ftp" >> /etc/vsftpd.chroot_list
建立放置每个ftp用户的独自的配置文件的目录
# mkdir /etc/vsftpd
修改/etc/vsftpd.conf
# vi /etc/vsftpd.conf
anonymous_enable=NO
local_enable=YES
write_enable=NO
local_umask=022
anon_umask=022
anon_upload_enable=NO
anon_mkdir_write_enable=NO
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_file=/var/log/vsftpd.log
idle_session_timeout=600
data_connection_timeout=120
ftpd_banner=Welcome!
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
user_config_dir=/etc/vsftpd
ls_recurse_enable=NO
hide_ids=YES
userlist_enable=YES
userlist_deny=NO
userlist_file=/etc/vsftpd.user_list
guest_enable=YES
guest_username=ftp
max_clients=50
max_per_ip=2
pasv_min_port=55000
pasv_max_port=55100
listen=YES
local_root=/data/ftp/$USER # 每个用户都有自己的ftp主目录
user_sub_token=$USER
建启动脚本
# vi /etc/rc3.d/S83vsftpd
#!/sbin/shcase "$1" in
start)
/usr/local/bin/vsftpd &
;;
stop)
pkill vsftpd
;;
*)
echo "Usage: $0 { start | stop }"
exit 1
;;
esac
exit 0
4. 用户管理
手工添加用户
# useradd -d /dev/null -g ftp -s /bin/false test
设置密码
# passwd test
在/etc/vsftpd/下添加一个与用户名相同名字的文件
# vi /etc/vsftpd/test
若只允许下载,则添加如下内容
anon_world_readable_only=no
anon_max_rate=512000
若允许上传,则添加如下内容
anon_world_readable_only=NO
write_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
anon_max_rate=1024000
追加新增的用户test到/etc/vsftpd.user_list文件
# echo "test">> /etc/vsftpd.user_list
建立test用户的ftp主目录
# mkdir /data/ftp/test
# chown ftp:ftp /data/ftp/test
5. 用户管理脚本
方便添加、删除用户、修改用户密码
安装脚本运行需要的软件包:
# wget ftp://mirror.sprintlink.net/sunfreeware.com/pub/freeware/sparc/9/tcl-8.4.6-sol9-sparc-local.gz
# gunzip tcl-8.4.6-sol9-sparc-local.gz
# pkgadd -d tcl-8.4.6-sol9-sparc-local
# wget ftp://mirror.sprintlink.net/sunfreeware.com/pub/freeware/sparc/9/tk-8.4.6-sol9-sparc-local.gz
# gunzip tk-8.4.6-sol9-sparc-local.gz
# pkgadd -d tk-8.4.6-sol9-sparc-local
# wget ftp://mirror.sprintlink.net/sunfreeware.com/pub/freeware/sparc/9/expect-5.40-sol9-sparc-local.gz
# gunzip expect-5.40-sol9-sparc-local.gz
# pkgadd -d expect-5.40-sol9-sparc-local
setpasswd.exp
#! /usr/local/bin/expect -f
#username is passed as 1st arg,password as 2nd
set password [lindex $argv 1]
spawn passwd [lindex $argv 0]
expect "*Password:"
send "$passwordr"
expect "*Password:"
send "$passwordr"
expect eof
ftpuseradd
#!/sbin/sh
# ftpuseradd
usage()
{
echo "Usage: `basename $0` [-w] [-m maxrate] username password"
exit 1
}
WRITABLE="no" # can't upload
MAXRATE="64000" # default max rate is 64Kb
OPT="no"
while getopts :wm: OPTION
do
case $OPTION in
w) WRITABLE="yes"
OPT="yes"
;;
m) MAXRATE=$OPTARG
OPT="yes"
;;
?) usage
;;
esac
done
shift `expr $OPTIND - 1`
if [ $# -ne 2 ]
then
usage
fi
USERNAME=$1
PASSWORD=$2
useradd -d /dev/null -g ftp -s /bin/false $USERNAME
if [ $? -eq 0 ]
then
setpasswd.exp $USERNAME $PASSWORD > /dev/null
echo "anon_world_readable_only=NO" > /etc/vsftpd/$USERNAME
echo "anon_max_rate=$MAXRATE" >> /etc/vsftpd/$USERNAME
if [ "$WRITABLE" = "yes" ]
then
echo "write_enable=YES" >> /etc/vsftpd/$USERNAME
echo "anon_upload_enable=YES" >> /etc/vsftpd/$USERNAME
echo "anon_mkdir_write_enable=YES" >> /etc/vsftpd/$USERNAME
echo "anon_other_write_enable=YES" >> /etc/vsftpd/$USERNAME
fi
echo "$USERNAME" >> /etc/vsftpd.user_list
mkdir /data/ftp/$USERNAME
chown ftp:ftp /data/ftp/$USERNAME
fi
ftpuserdel
#!/sbin/sh# ftpuserdel
usage()
{
echo "Usage: `basename $0` [-r] username"
exit 1
}
REMOVEDIR="no"
while getopts :r OPTION
do
case $OPTION in
r) REMOVEDIR="yes"
;;
?) usage
;;
esac
done
shift `expr $OPTIND - 1`
if [ $# -ne 1 ]
then
usage
fi
USERNAME=$1
userdel $USERNAME
if [ $? -eq 0 ]
then
if [ -f /etc/vsftpd.user_list ]
then
cat /etc/vsftpd.user_list | sed "/^$USERNAME$/d" | sed '1,$ w /etc/vsftpd.user_list' > /dev/null
fi
if [ -f /etc/vsftpd/$USERNAME ]
then
rm -f /etc/vsftpd/$USERNAME > /dev/null
fi
if [ -d /data/ftp/$USERNAME -a "$REMOVEDIR" = "yes" ]
then
rm -rf /data/ftp/$USERNAME > /dev/null
fi
fi
ftppasswd
#!/sbin/sh
# ftppasswd
usage()
{
echo "Usage: `basename $0` username password"
exit 1
}
if [ $# -ne 2 ]
then
usage
fi
USERNAME=$1
PASSWORD=$2
setpasswd.exp $USERNAME $PASSWORD
1. 6. 参考
Manpage of VSFTPD.CONF, http://vsftpd.beasts.org/vsftpd_conf.html
Freeware for Solaris, http://www.sunfreeware.com/
在SOLARIS上编译安装VSFTPD, http://bbs.chinaunix.net/forum/viewtopic.php?t=344943
删除一个文件后,在commit之前可以用add命令来undo。
1. HP-UX 11i下使用net-snmp,如snmptrap程序,提示找不到动态库libnetsnmp.sl.6。SHLIB_PATH环境变量已经设置了也不行。
解决办法:用chatr命令检查snmptrap程序,发现首选使用的是静态链接库。用chatr命令更改优先查找SHLIB_PATH就好了,命令如下:
2. 启动snmptrap时报错:
IF-MIB: Module not found
TCP-MIB: Module not found
UDP-MIB: Module not found
HOST-RESOURCES-MIB: Module not found
SNMPv2-MIB: Module not found
RFC1213-MIB: Module not found
SNMPv2-SMI: Module not found
NOTIFICATION-LOG-MIB: Module not found
UCD-SNMP-MIB: Module not found
UCD-DEMO-MIB: Module not found
SNMP-TARGET-MIB: Module not found
NET-SNMP-AGENT-MIB: Module not found
SNMP-VIEW-BASED-ACM-MIB: Module not found
SNMP-COMMUNITY-MIB: Module not found
UCD-DLMOD-MIB: Module not found
SNMP-FRAMEWORK-MIB: Module not found
SNMP-MPD-MIB: Module not found
SNMP-USER-BASED-SM-MIB: Module not found
SNMP-NOTIFICATION-MIB: Module not found
SNMPv2-TM: Module not found
原因:需要设置MIBDIRS环境变量
3. 安装Oracle时会出现一些类似下面的字符集警告信息,无关大局但令人不太舒服。
Warning: Cannot convert string "-dt-interface system-medium-r-normal-s*-*-*-*-*-*-*-*-*" to type FontSet
Warning: Missing charsets in String to FontSet conversion
Warning: Cannot convert string "-dt-interface user-medium-r-normal-s*-*-*-*-*-*-*-*-*" to type FontSet
解决办法:
4. 使用ps命令时如何查看进程的其他信息?
使用如下命令可以返回指定的信息
# UNIX95= ps -e -o "user,pcpu,cpu,vsz,pid,ppid,args" | sort -rnk4
5. 如何得到HostID?
见 http://www.synopsys.com/support/keys/hostid.html#hpux
6. 启动CDE时报错:
The desktop messaging system could not be started
原因:/etc/resolv.conf设置了DNS服务器,但没有/etc/nsswitch.conf文件。
解决方法:
并修改/etc/nsswitch.conf,把
hosts: dns [NOTFOUND=return] nis [NOTFOUND=return] files
改成
hosts: files dns [NOTFOUND=return] nis [NOTFOUND=return]