Issue with SFTP from different server by


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Issue with SFTP from different server by
# 1  
Old 11-15-2010
Issue with SFTP from different server by

Hi ,

I have 2 servers , say Server A and Server B .
ssh keys have been exchanged for unix account sftpuser(created on server A) in such a way that A shell script (Script1.Sh) written on Server A can PULL flat files from Server B and save them on server A .

Now I am able to execute successfully this shell script Script1.sh by logging in to sftpuser account on Server A .

But my issue is that I want to execute this script Script1 from a different unix user (say user1) so that files get copied from server B to Server A .
When I tried to execute the script by loggin in to "User1" , since the ssh keys not exchanged for User1 , it fails.

Could you please guide me how to execute the script from user1 as like I am executing it from sftpuser?

Thanks and regards
Amit
# 2  
Old 11-15-2010
I believe you will also have to exchange keys for User1.
# 3  
Old 11-15-2010
copy the keys you already put over there in user2's .ssh directory to user1's .ssh directory.

Logged on as user2
Code:
ssh user1@remotenode ' [ your command goes here]'

# 4  
Old 11-19-2010
Thanks !

youmean to say I need to login to user2 and
then do 'ssh user1@servername'

I will give a try . Actualy I do not have permission to copy key file so will need to help from Administrator

But my question is , actualy the two useras are on same server . Will this really work ?

Regards
Amit
# 5  
Old 11-19-2010
Quote:
But my question is , actualy the two useras are on same server . Will this really work ?
Yes, it will as long as sshd is running and access properly configured. You can use 'localhost' as server name, or its DNS name in your network.

BTW if you're on linux, there's the ssh-copy-id script to perform the key exchange.

HTH,
Loïc
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

SFTP issue

I'm trying to transfer a 1 GB file using sftp process. The process always gets disconnected in between (may be after 20%) file transfer when it runs from a batch script. If i do it in interactive mode, it works.. I checked with account admin to see the timeout option if any, but didn't help..... (2 Replies)
Discussion started by: Aswin Pillai
2 Replies

2. Shell Programming and Scripting

SFTP issue

Hi, I am trying to connect to a windows server via sftp from a user A and my job did log into it via user B. So I uses the following command to connect to teh new server. B>sftp -o IdentityFile=/pathtofile/id_rsa a@windows_server and it worked. But I don't want to use private key. Can we... (6 Replies)
Discussion started by: George1234
6 Replies

3. Shell Programming and Scripting

Needed SFTP script from windows to UNIX server and from UNIX to windows server(reverse SFTP)

hi guys, i need a script to sftp the file from windows to unix server ....(before that i have to check whether the file exists in the windows server or not and again i have to reverse sftp the files from unix to windows server..... regards, Vasa Saikumar. (13 Replies)
Discussion started by: hemanthsaikumar
13 Replies

4. Solaris

Script to get files from remote server to local server through sftp without prompting for password

Hi, I am trying to automate the process of fetching files from remote server to local server through sftp. I have the username and password for the remote solaris server. But I need to give password manually everytime i run the script. Can anyone help me in automating the script such that it... (3 Replies)
Discussion started by: ssk250
3 Replies

5. Shell Programming and Scripting

Sftp script for dev server to client server

hi, i am new to unix, cuold u send some sftp acripts to send files to dev server to clint server, (1 Reply)
Discussion started by: Koti.annam
1 Replies

6. Shell Programming and Scripting

Sftp some files from windows server to UNIX server

hi i need to transfer some files from windows server to unix server using SFTP. but before transferring the files, i need to check the existence of a particular file in the remote directory (say r_dir1). if the file is present, then SFTP all the files. after SFTPing the files from the remote... (1 Reply)
Discussion started by: vinit raj
1 Replies

7. Red Hat

sftp issue

Hi experts, While trying to sftp from one the red hat linux box it is giving following error. Status: Connecting to 10.1.82.155... Response: fzSftp started Command: open "prodbill@10.1.82.155" 22 Command: Pass: *********... (2 Replies)
Discussion started by: sai_2507
2 Replies

8. Shell Programming and Scripting

Issue with sftp

Hi Friends, I have created a shell and which will sftp file1 from serverA to serverB. In sftp prompt on serverA it is showing the file1 is available on serverB. where as when connected to ServerB it is not showing the file1. How come this. ServerA sftp> ls hsstest.dmp sftp> pwd Remote... (9 Replies)
Discussion started by: sriramis4u
9 Replies

9. AIX

SFTP issue

Hi!! SFTP5.0 is not working thru automatically pushing files, but manual file transfer is happening fine... If anyone knows,Pls share the reason. Regards, Senthil (3 Replies)
Discussion started by: senthil_seera
3 Replies

10. UNIX for Dummies Questions & Answers

SFTP script issue

Please excuse this post if it is in the wrong area. We are in the process of rewriting our ftp scripts to use sftp. Unfortunately I have been unable to come up with a solution for the following line in my ftp script: mls ALL_$DT.txt all_tmp.txt The mls command is not available in under sftp... (0 Replies)
Discussion started by: sdhalepaska
0 Replies
Login or Register to Ask a Question