SFTP connection to SSH2 UNIX server


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers SFTP connection to SSH2 UNIX server
# 1  
Old 02-19-2012
SFTP connection to SSH2 UNIX server

Plz share how we can make a passwordless SSH connection from a SSH1 UNIX server to SSH2 UNIX server.
# 2  
Old 02-19-2012
1. Generate private and publick key on ssh1 machine. Press ENTER when prompted for passphrase which means you will be using empty passphrase.
Code:
ssh-keygen -t dsa -b 1024

2. Get the id_dsa.pub file from /home/your_user_name/.ssh/ directory on ssh1 machine and copy/append that to /home/your_username/.ssh/authorized_keys file on ssh2 machine.

You can now do ssh into ssh2 machine without password.
# 3  
Old 02-19-2012
Quote:
Originally Posted by admin_xor
1. Generate private and publick key on ssh1 machine. Press ENTER when prompted for passphrase which means you will be using empty passphrase.
Code:
ssh-keygen -t dsa -b 1024

2. Get the id_dsa.pub file from /home/your_user_name/.ssh/ directory on ssh1 machine and copy/append that to /home/your_username/.ssh/authorized_keys file on ssh2 machine.

You can now do ssh into ssh2 machine without password.
I have the RSA and DSA pub keys on svr1.
I tried the above but asking for password Smilie

I tried keeping authorized_keys file in .ssh and .ssh2 folders also ...
# 4  
Old 02-19-2012
Even after installing public key on the target host, and updating the authorized file, ssh will prompt for a password should file permissions on the ~/.ssh directory, and files within, not be what ssh expects/desires. The quote below is from the ssh manual page and lists good settings:


Quote:
~/.ssh/
This directory is the default location for all user-specific configuration and authentication information. There is no general requirement to keep the entire contents of this directory secret, but the recommended permissions are read/write/execute for the user, and not accessible by others.

~/.ssh/authorized_keys
Lists the public keys (RSA/DSA) that can be used for logging in as this user. The format of this file is described in the sshd(8) manual page. This file is not highly sensitive, but the recommended permissions are read/write for the user, and not accessible by others.

~/.ssh/config
This is the per-user configuration file. The file format and configuration options are described in ssh_config(5). Because of the potential for abuse, this file must have strict permissions: read/write for the user, and not accessible by others.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

Passwordless sftp connection from UNIX to windows server

HI , I am trying to make a passwordless sftp connection from a unix server to windows server I have used a existing script which is like this cd /home150/adm/.ssh/ ssh-agent /usr/bin/ksh <<EOF ssh-add IDBNEWKEY ssh-add -l sftp IDBUSER@abc.com cd /home/IDBUSER/Share/IDB/ rm ${FILE}... (0 Replies)
Discussion started by: Jcpratap
0 Replies

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

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

4. UNIX for Dummies Questions & Answers

For SFTP connection - How to give password in UNIX Script (ksh)

Hi, I am not able to give the password in Unix script for SFTP connection. When I am trying to manully SFTP command for accessing the server , it asking for pwd and I could provide the pwd but I am not getting how to provide the pwd inside the Unix script. sftp -v user@xyz.com. ... (4 Replies)
Discussion started by: Vineeta Nigam
4 Replies

5. UNIX for Dummies Questions & Answers

sftp connection to the same server(from same server)

Hi, After logging in to a server, Can I open a new sftp connection to the same server from the same server itself. Does it have any connection issues/limitations for ports etc. and can I copy/move files using the new sftp connection in the same server. Do we have any limitations of opening new... (1 Reply)
Discussion started by: Mathews567
1 Replies

6. Solaris

SFTP from SSH2 to SSH

Hi, Earlier, I have configured SFTP successfully in my prev jobs. This time I have to configure SFTP for local server (uses SSH2) and remote server (uses SSH). I tried to search the forum. I did not find the right thread. I appreciate your help. The following is the additional info >... (5 Replies)
Discussion started by: bobbygsk
5 Replies

7. Shell Programming and Scripting

sftp connection from Unix to windows

Hi guyz, I have a Solaris 5.9 box from which i need to connect to a windows server using Coreftp (passwordless login). Coreftp is installed on windows and in solaris, it is already available.I generated a pair of key(public,private) in windows and specify pub key over there, edit the know_hosts... (7 Replies)
Discussion started by: Renjesh
7 Replies

8. Shell Programming and Scripting

sftp Connection from Unix to Windows 2003 server using Passphrase

Hi All, I am trying to connect from Unix machine to Windows 2003 server using passphrase method. It is connecting to the server and the connection is immediately closing. Below is the stack trace. Can anyone let me know what wrong with it? cwadmin@iut1wps1:/home/cwadmin> ssh username@targetip... (1 Reply)
Discussion started by: vijayin
1 Replies

9. UNIX for Dummies Questions & Answers

ssh2 & sftp help

Hi, I need to implement sftp between server 1 and server2. I have already generated the public key using account user1 on server 1 and and sent it to the administrator of server2. I have also finished updating the identification file at /home/user1/.ssh2 I have an account created... (11 Replies)
Discussion started by: tansha
11 Replies

10. UNIX for Dummies Questions & Answers

Connection Lost from Unix Server....

This morning I was working by Xwindow to my unix server (hp-ux, 11 version), without any problem but this afteernoon, the connections was refused, and triying to connect using telnet, sometimes I can establish the connection and refuses me in a minute, the error message that appears is "your... (1 Reply)
Discussion started by: fvicente
1 Replies
Login or Register to Ask a Question