From: Brian Candler Date: 2003-07-27T01:02:27+09:00 Subject: Re: Confused about locking a file via file.flock(File::LOCK_EX) On Sun, Jul 27, 2003 at 12:27:42AM +0900, Ludwigi Beethoven wrote: > Well, I am using AIX version 4. I tried a similar > test and I was able to change and save /etc/hosts. Perhaps try installing a newer version of vi - such as vim? Maybe the AIX stock vi doesn't attempt to get a lock on the file when opening it. > The program will provide remote printing support to a > Windows/98 ws with a printer attached to it, managed > by a lpd server. The user comes in via a VPN that > provides a different IP address with every connection. > That's the reason to update the /etc/hosts table. Does your lpd refuse a connection from someone who is not in /etc/hosts? If so, could you not just list all the addresses they could come from in /etc/hosts? If it's a true VPN then that should be safe. If the idea is to enable lpd for hosts which could be connecting from anywhere on the Internet but need to authenticate themselves first, I would probably use ssh tunnelling. ssh lpd Client ----------------> gateway --------> printer host host Client side: ssh -L 515:printerhost:515 username@gatewayhost Gateway host: just enable sshd Printer host: just put the gateway host IP address/name in /etc/hosts.lpd Then, when the client prints to 127.0.0.1 port 515, it is relayed through the ssh tunnel to the gateway host, which then opens a TCP connection to port 515 on the printer host, and passes the traffic through. (The printer host and gateway host can be the same machine, of course) You get the advantages of a proper encrypted session and whatever authentication you choose to use for ssh - passwords, RSA keys etc. There are plenty of free ssh clients for Windows, most of which support tunneling (try putty or teraterm pro + ttssh) Regards, Brian.