2010年5月5日星期三

HPUX:FTP 如何将FTP用户锁定在固定目录

HPUX:FTP 如何将FTP用户锁定在固定目录

目的:
HPUX的FTP为wuftp,默认用realuser访问,如果权限足够,可访问整个系统.
本文的目的,就是令到某用户登录后,只能访问指定的目录,不可访问该目录外的文件夹.

系统:
HP-UX 11.23

方法:

1.启用配置文件
 vi /etc/inetd.conf
>> notice -a
ftp stream tcp nowait root /usr/lbin/ftpd ftp -l -a

如果想取消,用
ftp stream tcp nowait root /usr/lbin/ftpd ftp -l -A

2.重新初始化
inetd -c

3.创建配置文件
On HP-UX 11:
# cp /usr/newconfig/etc/ftpd/ftpaccess /etc/ftpd/ftpaccess

On HP-UX 11i:
# cp /usr/newconfig/etc/ftpd/examples/ftpaccess /etc/ftpd/ftpaccess

vi /etc/ftpd/ftpaccess
>>
guestuser myname
guest-root /home/myname/html myname

4.令到客户端可以 ls / pwd

mkdir -p usr/bin
cp /sbin/ls usr/bin
cp /bin/pwd usr/bin


5.其他
touch /etc/ftpd/ftpgroups

vi /etc/ftpd/ftpusers

# ftpusers
root
guest


Resource Link:
http://newfdawg.com/SHP-FTP-ftpaccess.htm
http://docs.hp.com/en/B2355-91058/ch02.html
http://fanqiang.chinaunix.net/a1/b6/20020408/080200169.html

2010年3月19日星期五

Howto install 3G card [HUAWEI E1750 WCDMA] in archlinux

1.Download

http://www.draisberghof.de/usb_modeswitch/

cd /tmp

wget http://www.draisberghof.de/usb_modeswitch/usb-modeswitch-1.1.1.tar.bz2



2.Install

cd usb-modeswitch-1.1.1

sudo make install

sudo vi /etc/usb_modeswitch.conf

>>

########################################################

# Huawei E1550

# Huawei E1750

#

# Contributor: Anders Blomdell, Ahmed Soliman

DefaultVendor= 0x12d1

DefaultProduct= 0x1446

TargetVendor= 0x12d1

TargetProduct= 0x1001

# only for reference and 0.x versions

# MessageEndpoint=0x01

MessageContent="55534243123456780000000000000011060000000000000000000000000000"

sudo /usr/sbin/usb_modeswitch -W -c /etc/usb_modeswitch.conf

$ ls -l /dev/ttyUSB0

crw-rw---- 1 root uucp 188, 0 3月 19 16:13 /dev/ttyUSB0



3.Setup kppp

New account :WCDMA

Phone no:*99#

authentication : PAP

Call back : No

pppd parameters:

noauth
usepeerdns
noipdefault
defaultroute

MODEM:DEVICE

new HUAWEI E1750

Device: /dev/ttyUSB0

Flow control: Hardware [CRTSCTS]

Line end : CR

Speed : 460800

Use file lock : yes

MODEM:MODEM

Query modem


4.How to use it:

plug in the usb modem

sudo /usr/sbin/usb_modeswitch -W -c /etc/usb_modeswitch.conf\

$ ls -l /dev/ttyUSB0

crw-rw---- 1 root uucp 188, 0 3月 19 16:13 /dev/ttyUSB0

sudo kppp

connect

2010年2月28日星期日

HP-UX:ISSUE: SYSERR(root): savemail: cannot save rejected email anywhere

情况:
登录服务器后,控制台会不断提示以下错误:
SYSERR(root): savemail: cannot save rejected email

/var/tmp/dead.letter 增长迅速

日志:
From MAILER-DAEMON Mon Mar 1 11:57:40 2010
Return-Path: <MAILER-DAEMON>
Received: from localhost (localhost)
by hwcln43.ebis.com (8.9.3/8.9.3) with internal id L~X06469;
Mon, 1 Mar 2010 11:57:40 +0800 (EAT)
Date: Mon, 1 Mar 2010 11:57:40 +0800 (EAT)
From: Mail Delivery Subsystem <MAILER-DAEMON>
Message-Id: <201003010357.L~X06469@hwcln43.ebis.com>
To: root
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
boundary="L~X06469.1267415860/hwcln43.ebis.com"
Subject: Returned mail: Host unknown (Name server: wcat: host not found)
Auto-Submitted: auto-generated (failure)

分析:
系统发错误邮件到本地账户时,发给了 username@wcat
sendmail.cf 的 [DR] 设置为 [DR wcat] ,配置错误

处理方法:
1.把 /etc/mail/sendmail.cf 的 [DR wcat] 改为 [DR]
2./sbin/init.d/sendmail stop
3./sbin/init.d/sendmail start