Login getting locked on sftp


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Login getting locked on sftp
# 1  
Old 06-18-2013
Sun Login getting locked on sftp

Hey All,

I have a ascript which sftp files from Solaris to Windows. I am usgin expect and sending password though script.

I have observed that sometimes script works fine (manually or in cron) but after some run, the user I am usgin to connect is getting locked on Domain level.

I am sending same password through script still same script locks out the user because of 3 wrong password attempts.

Any clues ?
# 2  
Old 06-18-2013
You may need to make your expect script conditional. Its is very much possible that that there is a long delay between Username: and Password: prompts and your script is not waiting enough and ending up sending the subsequent commands instead of password on the Password: prompt.
This User Gave Thanks to rajamadhavan For This Post:
# 3  
Old 06-18-2013
Thanks rajamadhavan,

Yes, there is delay when sftp is trying to connect to the server. I got your point and yes, that might be the reason.

Can you help lil bit more, can you please show me any example of conditional expect. I am using expect in bash script.
# 4  
Old 06-18-2013
Something like this...

Code:
set timeout 20
spawn telnet blahblah
expect 'Login: '
send "loginname\r"
expect {                
password: {         
send "password\r"     
} timeout {       
 exit     
} eof { 
exit     
} 
}

# 5  
Old 06-18-2013
Thanks dude, will try this today
# 6  
Old 06-21-2013
I have tried with timeout but didnt helped.
Is there any cron related issues if I run bash script on csh ?
# 7  
Old 06-21-2013
Running a bash script in the csh shell will almost certainly break it. (This is not the same thing as just using csh to execute a bash script externally.)

Last edited by Corona688; 06-21-2013 at 12:38 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Login shows "PS" but locked

Hello my o/s is: SunOS sjcorpftp 5.10 Generic_118855-36 i86pc i386 i86pc I am sys admin for several Sun boxes, whenever a user cannot login I do a "passwd -s login-name" the majority of the time the login status will show "PS" when it is locked once I unlock it, they can login Has... (2 Replies)
Discussion started by: ikeleong
2 Replies

2. Shell Programming and Scripting

Password less login for sftp

Hi, I am using public key authentication for login into a remote sftp server (password less login). so i have set up a password less login according to this link . i have copied the content of my .pub file to remote server's authorized_keys2 file. i want to find out whether my .pub file... (2 Replies)
Discussion started by: Little
2 Replies

3. Shell Programming and Scripting

Need Help on SFTP login from another server

Hi Experts, I am writing one shell script. Below is the requirement 1. need to login to the SFTP server, go to the particular folder 2. take the file count in that folder and assign it to variable 3. came out of the SFTP server and check the condition, if the file count is less than the... (1 Reply)
Discussion started by: bbc17484
1 Replies

4. Red Hat

Chroot sftp users, remote sftp login shows wrong timestamp on files

Hello, I have a weird issue, I have RHEL 5.7 running with openssh5.2 where sftpgroup OS group is chroot. I see the difference difference in timestamp on files, when I login via ssh and SFTP, I see four hour difference, is something missing in my configuration. #pwd... (8 Replies)
Discussion started by: bobby320
8 Replies

5. UNIX for Dummies Questions & Answers

Account is locked or login administratively denied

Hi, When I am trying to do ssh to a server it shows below error. Key setup is all good and it used to work well few days back. Now suddenly I am getting this error. ssh -i <private_key> <id>@<hostname> Received disconnect from <hostname> Account is locked or login administratively... (1 Reply)
Discussion started by: mahish20
1 Replies

6. UNIX for Dummies Questions & Answers

Locked out of ssh and sftp

I've been having troubles where i get locked out of shh and sftp. It happens overnight and when i come in the next day i have been locked out and can't seem to log in to the server through ssh or sftp. It is a co location server and each day i am having to have the hosts restart my server. When... (2 Replies)
Discussion started by: timgolding
2 Replies

7. UNIX for Dummies Questions & Answers

Only root can login using SFTP

Hello, It seems on a machine that I am responsible for supervising only root can use ssh/sftp services. I have looked at sshd_config and do not see anything that can fix this. PermitRootLoggin is enabled but that option does not preclude other users from using ssh/sftp services. When I try and... (5 Replies)
Discussion started by: mojoman
5 Replies

8. Shell Programming and Scripting

sftp auto login

Hi, I looked into lot of posts on this question but i could not figure out the solution. we are using the following ftp shell program to send the file to target server. #!/usr/bin/ksh ftp -n -i<<EOF 2>&1 open <target server ip> user <username> <pwd> lcd /sc/doc/prd/FCSTP put file1.txt... (3 Replies)
Discussion started by: srrao.ch
3 Replies

9. Solaris

Auto login with SFTP

Hi All, How do you get around SFTP not having the 'cat' command to set up scripts to run cron jobs for passwords? I am use to the FTP allowing that, but we are converting to SFTP and need to be able to still run the same scripts in off hrs. Is there a way to still cat the password at the prompt... (14 Replies)
Discussion started by: wsiefkas
14 Replies

10. HP-UX

SFTP silent login

Hi, I am connecting via SFTP to a remote Server. My problem is on trying to LOGin, I am asked for a password. I need to make this process automatic such that I can login without being prompted for a password. I can achieve this if the remote server has a simple FTP server and not SFTP. How... (6 Replies)
Discussion started by: sgaucho
6 Replies
Login or Register to Ask a Question