01-24-2007
ftp check for failed attempts
Hi,
I have created the below ftp script to put files over to our capacity server, the check at the end works if ftp fails to run however if the script cannot login or the transfer itself failed there is no warnings.
Does anyone know the syntax to trap the erorr codes or to put a check within FTP?
Thanks a million ....
# create an ftp script to move the data to sftp
echo "ftp -v -i -n $SERV <<!EOF" > $FTP
echo "user capacity.ftp C@p@C1ty" >> $FTP
echo "binary" >> $FTP
echo "prompt" >> $FTP
# Find the processed nmon file to be sent to capacity server for processing:
cd $OUTDIR
PDATE=`perl -le '($year,$mon,$day,$hrs,$min)=(localtime(time()-$ARGV[0]))[5,4,3,2,1];printf "%04d%02d%02d_%02d\n",$year+1900,$mon+1,$day,$h
rs,$min' 3600`
TFILE=`ls ${NFILE}_${PDATE}*.csv`
if [ -f ${OUTDIR}/${TFILE} ] ; then
continue
else
logfile "$TFILE is not available for transfer, please investigate and transfer the file."
exit 1
fi
echo "mput $TFILE" >> $FTP
echo "$DATE:$TIME//Transfering $TFILE to $SERV " >> $PROGLOG
echo "!EOF" >> $FTP
chmod 777 $FTP
#$FTP
if [ $? -ne 0 ] ; then
logfile "failed to FTP $TFILE to $SERV"
fi
9 More Discussions You Might Find Interesting
1. AIX
Hi. I would like to be able to deny IP address for too many failed login attemps (either from ssh, sftp, ftp, etc). The system I wish this to work on is an AIX 5.1 system. I'm new to AIX but I'm a linux user. There is a program for linux called fail2ban which reads from the log files and see if... (1 Reply)
Discussion started by: metzgerh
1 Replies
2. UNIX for Advanced & Expert Users
Hi,
We have some clients who will place huge files in to one of the remote server.
And the shell script written in our local server to retrieve client files (using FTP) placed on one of the remote server of ours by clients.
My question Is there any FTP command/script to check from my local... (1 Reply)
Discussion started by: nmsrao
1 Replies
3. Solaris
Hi guys, Can you please help me.
I have SUN V100 server running solaris 8.
I also have a Redhat Linux 6.2 machine and a windows XP machine on the network.
I'm trying to copy files from the Linux and XP machines to the V100 server.
When I try to ftp to the solaris machine, I'm challenged... (2 Replies)
Discussion started by: Stin
2 Replies
4. UNIX for Dummies Questions & Answers
Dear experts,
I am seeing a lot of TCP failed connection attempts from "netstat -s" on one of our servers.
How can I pin point what connection failed and what are the ports involved?
Any tools/commands I can dig in deeper to diag. what went wrong on these "failed connection attempts"?
... (2 Replies)
Discussion started by: cache51
2 Replies
5. Shell Programming and Scripting
I have automated ftp for different scripts. every script uses different login and passwords for different server. it reads the username and password from netrc.
there is 1 particular script that is failing. this script is failing in FTP step. i have checked the logs it says login failed. but... (5 Replies)
Discussion started by: dazdseg
5 Replies
6. UNIX for Dummies Questions & Answers
Hi All,
We are using the following step to place a file in server using FTP
STEP_EXECUTE STEP090 /usr/pjc/bin/FTP -i
DATASET FTPIN $sic/ctl/ftpsic.ctl DISP=OLD,KEEP,KEEP
STEP_END
If we run this step we are getting the error.
ftp> open arg.mnd.appsc.com
Connected to arg.mnd.appsc.com.... (4 Replies)
Discussion started by: ajaykumarkona
4 Replies
7. Solaris
Hey all I'm having a big problem here. Someone is attempting an SSH to a destination host on which an account resides and locking the account. I'm trying to determine who is performing the SSH attempts from my host. For instance they're logged in as their standard account but then (I'm assuming)... (13 Replies)
Discussion started by: MaindotC
13 Replies
8. Solaris
Hi Guys,
I need to check why FTP service on Solaris 10 machine did not work in between.
What does Jun-29 means here? Does it mean that it has been RUNNING/UP since Jun 29th ?
-bash-3.2$ sudo /usr/bin/svcs |grep -i ftp
legacy_run Jun_29 lrc:/etc/rc3_d/S90proftpd
online ... (3 Replies)
Discussion started by: manalisharmabe
3 Replies
9. Cybersecurity
The purpose of this thread is for everyone to follow the same methodology so we can create a future table, for the benefit of all, that shows how many failed login attempts (hacking) per day per server (and per minute) are happening.
This is not a thread on writing scripts or creating... (10 Replies)
Discussion started by: Neo
10 Replies
LEARN ABOUT X11R4
ftpconfig
ftpconfig(1M) System Administration Commands ftpconfig(1M)
NAME
ftpconfig - set up anonymous FTP
SYNOPSIS
ftpconfig [ftpdir]
ftpconfig -d ftpdir
DESCRIPTION
The ftpconfig script is executed by the super user to set up anonymous FTP. Anonymous FTP allows users to remotely log on to the FTP server
by specifying the user name ftp or anonymous and the user's email address as password. The anonymous users are logged on to the FTP
Server and given access to a restricted file area with its own file system root. See chroot(2). The FTP area has its own minimal system
files.
This command will copy and set up all the components needed to operate an anonymous FTP server, including creating the ftp user account,
creating device nodes, copying /usr/lib files, and copying timezone data. The passwd and group files set up have been stripped down to
prevent malicious users from finding login names on the server. The anonymous file area will be placed under ftpdir. If the ftp user
account already exists, then the current FTP area is used, and the system files in it are updated. All other files are left untouched. This
command should be run to update the anonymous FTP area's configuration whenever a system patch is installed, or the system is upgraded.
OPTIONS
-d Create a new or update an existing ftpdir without creating or updating the ftp user account. Use this option when creating guest
FTP user accounts.
OPERANDS
The following operands are supported:
ftpdir The absolute pathname of the directory under which the anonymous FTP area is set up.
EXIT STATUS
The following exit values are returned:
0 Successful completion
1 Improper usage of the command
2 Command failed
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWftpu |
+-----------------------------+-----------------------------+
|Interface Stability |Evolving |
+-----------------------------+-----------------------------+
SEE ALSO
ftpaddhost(1M), in.ftpd(1M), useradd(1M), chroot(2), attributes(5)
SunOS 5.10 1 May 2003 ftpconfig(1M)