11-19-2010
Though this sounds silly...Can i write expect script in Linux environment?
If so...will this work?
#!/bin/sh
server=ftpproxy
user_id=user
k123456@xxx.abcdef.com
password=password
dir=/abc/xyz/work
filename=1234.def.ghi.$$
cd $dir
spawn ftp $server
expect "username:"
# Send the username,
send "$user_id\r"
expect "password:"
# Send the password,
send "$password\r"
expect "ftp>"
# Switch to binary mode,
send "bin\r"
expect "ftp>"
# Turn off prompting.
send "prompt\r"
expect "ftp>"
# Get all the files
send "mget $filename\r"
expect "ftp>"
send "bye\r"
expect eof
Please let me know if i have to make any changes to the script.
Thanks in advance!!
10 More Discussions You Might Find Interesting
1. IP Networking
Hi,
I am involved in a project on Debian. One of my requirement is to route an IP packet in my application to a proxy server and receive the reply from the proxy server as an IP packet. My application handles data at the IP frame level. My application creates an IP packet(with all the necessary... (0 Replies)
Discussion started by: Rajesh_BK
0 Replies
2. Linux
I am having trouble connecting to the internet.
Details:
OpenSuse 11.1, Cable Modem, connected to Linksys Wireless N Router, hard line from router to ethernet port on my computer.
I checked network settings in YAST2, my ethernet is showing not connected. I have it set to start at boot, and... (4 Replies)
Discussion started by: stringzz
4 Replies
3. Shell Programming and Scripting
Hi,
Can someone help me on how to ftp to UNIX server from an another UNIX Server.
I tried the follwoing but it is not working.
ftp -n 10.10.0.1
quote user usrname
quote pass passwd
ls
Though ftp is starting it is not allowing me run command.....
it is asking to
Thanks in... (5 Replies)
Discussion started by: EmbedUX
5 Replies
4. UNIX for Advanced & Expert Users
Hi All,
can some one please help me to solve this issue, its urgent:confused:
We need to FTP a file form our Unix server to an external client FTP location.
I am trying to connect to the proxy server first and then use the below USER comment to connect to the external FTP server, and its working... (3 Replies)
Discussion started by: JesusJoseph
3 Replies
5. Red Hat
Hi all,
First of all i would like to say sorry to all for my english.
My name is Mastan. We have an proxy server have 2 lan cards. one is for public and another for private.
public ip: 182.72.141....
private ip: 192.168.0.0
So, the thing is i configure ftp server in my local for... (0 Replies)
Discussion started by: mastansaheb
0 Replies
6. Shell Programming and Scripting
Hi All,
I have a ftp link as "ftp://ftp1.xyz.org/abc_ike/". The same thing is opening fine when I use a browser. But I am not sure how to connect to the above link from console. I used the command
ftp ftp1.xyz.org
The above is not working. I am not getting any error it simply stands still.... (1 Reply)
Discussion started by: machomaddy
1 Replies
7. Solaris
Hi Everyone,
I am using solaris 10.I am facing a different problem here with tlsftp.I have intalled all steps for tlsftp and able to connect to the destination server from the source server.It worked for some days.But recently when i am connectin it is giving below error.I am... (0 Replies)
Discussion started by: muraliinfy04
0 Replies
8. Shell Programming and Scripting
Hi Friends
I have created a shell script to connect to a windows server. But the problem is while trying to run the script I am not getting any output. After running the script it is hanged and the prompt is not showing until if I press the ctrl+Z to break the script. I also tried using the FTP... (2 Replies)
Discussion started by: Kannannair
2 Replies
9. IP Networking
I need to configure a proxy on my local machine to use an upstream proxy (installed on another machine). The upstream proxy requires Digest/NTLM authorization. I want the local proxy to deal with the upstream proxy's authorization details and provides authorization free access to users that connect... (0 Replies)
Discussion started by: Russel
0 Replies
10. Ubuntu
Note: I originally posted this question on unix.stackexchange.com. But as my question was down-voted within an hour of asking, I came to the conclusion that perhaps I need to quit attempting to get help on StackExchange or that my inquiry is simply moronic. If anyone feels that my question is not... (7 Replies)
Discussion started by: AntumDeluge
7 Replies
LEARN ABOUT CENTOS
pam_ftp
PAM_FTP(8) Linux-PAM Manual PAM_FTP(8)
NAME
pam_ftp - PAM module for anonymous access module
SYNOPSIS
pam_ftp.so [debug] [ignore] [users=XXX,YYY,...]
DESCRIPTION
pam_ftp is a PAM module which provides a pluggable anonymous ftp mode of access.
This module intercepts the user's name and password. If the name is ftp or anonymous, the user's password is broken up at the @ delimiter
into a PAM_RUSER and a PAM_RHOST part; these pam-items being set accordingly. The username (PAM_USER) is set to ftp. In this case the
module succeeds. Alternatively, the module sets the PAM_AUTHTOK item with the entered password and fails.
This module is not safe and easily spoofable.
OPTIONS
debug
Print debug information.
ignore
Pay no attention to the email address of the user (if supplied).
ftp=XXX,YYY,...
Instead of ftp or anonymous, provide anonymous login to the comma separated list of users: XXX,YYY,.... Should the applicant enter one
of these usernames the returned username is set to the first in the list: XXX.
MODULE TYPES PROVIDED
Only the auth module type is provided.
RETURN VALUES
PAM_SUCCESS
The authentication was successful.
PAM_USER_UNKNOWN
User not known.
EXAMPLES
Add the following line to /etc/pam.d/ftpd to handle ftp style anonymous login:
#
# ftpd; add ftp-specifics. These lines enable anonymous ftp over
# standard UN*X access (the listfile entry blocks access to
# users listed in /etc/ftpusers)
#
auth sufficient pam_ftp.so
auth required pam_unix.so use_first_pass
auth required pam_listfile.so
onerr=succeed item=user sense=deny file=/etc/ftpusers
SEE ALSO
pam.conf(5), pam.d(5), pam(8)
AUTHOR
pam_ftp was written by Andrew G. Morgan <morgan@kernel.org>.
Linux-PAM Manual 09/19/2013 PAM_FTP(8)