SFTP issue


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting SFTP issue
# 1  
Old 05-26-2016
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.

Code:
B>sftp -o IdentityFile=/pathtofile/id_rsa a@windows_server

and it worked. But I don't want to use private key. Can we use public key in some way to achieve this?.

the unix enviroment is : HP-UX.

Thanks
George

---------- Post updated 05-26-16 at 12:29 AM ---------- Previous update was 05-25-16 at 08:35 PM ----------

Can some update regarding this? Isn't there any other way to do this?

Last edited by Scott; 05-26-2016 at 02:57 AM.. Reason: Use code tags
# 2  
Old 05-27-2016
I'm not quite sure what you are asking, so perhaps I'm off on the wrong track, but the public key would be shared/copied to the target server so that your client can open the connection.

The private key is not shared with anyone. The process, as I understand it, is that the host sending data encrypts it with the public key of the other. The public key of the server is shared to you as you open the connection first time (the question about the fingerprint and storing it in the known_hosts file) The only process that can decrypt each packet then is the one with (local & private) access to the private key. Your private key is never shared on the network.

What are you actually trying to achieve?
Can you give more examples (in CODE tags) of what you have set up - but don't publish your private key, naturally!



Thanks,
Robin
# 3  
Old 05-27-2016
Hi George1234,
The description you have provided seems to asking for a way to allow someone logged in as userA on an HP-UX system to impersonate userB to access files on a Windows server on your network.

The UNIX and Linux Forums is not a hackers website and you will not find anyone here who will help you hack into a server nor to impersonate another user to gain access to their private files. If this is not what you are trying to do, please describe more clearly what you are trying to do and explain why you don't just login as userB to access userB's files.
# 4  
Old 05-27-2016
DON,

our job runs with user A and public key in placed for it in windows server. But as we are moving some parts to a different unix server and we can place only one public key per user into this windows server.

So in our new server our jobs runs with A but could not connect to windows server via sftp because the windows server contains public key of the old one.( which we cant change). Therefore, we have setup different user B and put it's public key to the new sftp server. Now all of jobs with user A and so this sftp part also needs to be run via user A. So via below command the job connect to windows server.

a>sftp -o IdentityFile=/pathtofile/id_rsa b@windows_server

I am checking via any other way/command is possible to do this activity in unix, because we are using private key (which we don't want to do).

I guess, if the requirement is clearly understood now, then hacking possibility is certainly of out of question.
# 5  
Old 05-27-2016
I don't get it; mayhap I'm a bit thick here...

Put user A's public key into remote user B's authorized_keys (or however this may be called in windows) file, and try connecting interactively via ssh B@remote_server for a test.
What be the result?
# 6  
Old 05-27-2016
I tried it. But still, it looks for user A ( by which the jobs are running) profile. It never goes to check user B's authorized keys.
# 7  
Old 06-04-2016
Can you show us the output from what you are trying? If possible, can you add a -v flag and paste the results into the thread, in CODE tags naturally. This should clarify what you are trying to do and what refusal we are getting.



Robin
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. Solaris

Passwordless sftp issue

Hello Experts, I am trying to setup passwordless sftp from one of linux box to solaris box. I have generated key-pair and below is the permissions of the respective files. drwx------. 2 sftpuser sftpuser 4096 Dec 17 23:57 .ssh drwx------. 2 sftpuser sftpuser 4096 Dec 17 23:57 .... (16 Replies)
Discussion started by: sai_2507
16 Replies

3. 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

4. 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

5. UNIX for Advanced & Expert Users

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... (4 Replies)
Discussion started by: MrActionHero
4 Replies

6. Solaris

Urgent need help - issue sftp

hi experts, i have a problem with my sftp which install on sparc sun solaris os version 5.9, i have install this packages below on my server : libgcc-3.3-sol8-sparc-local openssl-0.9.8d-sol8-sparc-local zlib-1.2.3-sol8-sparc-local openssh-4.5p1-sol8-sparc-local and i... (2 Replies)
Discussion started by: bucci
2 Replies

7. 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

8. Shell Programming and Scripting

sftp BatchMode issue

Hello All, I have a issue with the below script that i am using to sftp a file. sftp -o BatchMode=yes $sftpLogin <<EOF cd /ftp/cds get cdstesting.csv quit EOF When i use this, the connetion establishes and the connections doesnt returns from and hangs in the connecting mode. I think... (0 Replies)
Discussion started by: kotasateesh
0 Replies

9. 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

10. AIX

SFTP Issue with ssh

Hello all, hopefuly this is the right place to post this. I am having an issue with a new sftp process on an AIX box. I created id_rsa.pub file and sent it to the person who runs the sftp process. He added the key to the authorized_Users (I only have phone contact with him and its an outside... (7 Replies)
Discussion started by: dbridle
7 Replies
Login or Register to Ask a Question