Sponsored Content
Top Forums Shell Programming and Scripting Passwordless SFTP - Can connect from server A to B; but vise-versa not happening Post 302969766 by mady135 on Monday 28th of March 2016 01:49:43 AM
Old 03-28-2016
Passwordless SFTP - Can connect from server A to B; but vise-versa not happening

Hi,

I am trying to execute password less SFTP between two servers A &B. While I was able to connect B from A; I am not able to connect the A from B.
I have done done similar steps for both scenarios:
  1. Creating public key using "ssh-keygen -t rsa".
  2. Appending the content to "authorized_keys" file.
  3. making sure .ssh directory has 700 permission and "authorized_keys" file has 600 permission.
Please help me to find whats wrong I am doing here.


File permission of Server A
Code:
A:pts/1:/home/mnand504/.ssh 355>ls -lart
total 128
drwxrwxr-x  19 mnand504   users         8192 Mar 24 06:12 ..
-rw-r--r--   1 mnand504   users            0 Mar 24 06:16 abc.txt
-rw-r--r--   1 mnand504   users          399 Mar 28 01:21 id_rsa.pub_MJ
-rw-------   1 mnand504   users          399 Mar 28 01:29 id_rsa.pub
-rw-------   1 mnand504   users         1679 Mar 28 01:29 id_rsa
-rw-r--r--   1 mnand504   users          444 Mar 28 01:30 known_hosts
drwx------   2 mnand504   users         8192 Mar 28 01:34 .
-rw-------   1 mnand504   users          399 Mar 28 01:35 authorized_keys

File permission of server B
Code:
/home/mnand504/.ssh
B->ls -lart
total 112
drwxrwxr-x   3 mnand504   users         8192 Mar 24 06:11 ..
-rw-r--r--   1 mnand504   users            0 Mar 24 06:14 abc.txt
-rw-r--r--   1 mnand504   users          888 Mar 28 01:22 known_hosts
drwx------   2 mnand504   users         8192 Mar 28 01:30 .
-rw-------   1 mnand504   users          798 Mar 28 01:30 authorized_keys
-rw-------   1 mnand504   users         1679 Mar 28 01:33 id_rsa
-rw-------   1 mnand504   users          399 Mar 28 01:33 id_rsa.pub

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to connect sftp server using script

Hi friend I have a command: sftp -v dtxsttp90102@dtx.us.dell.com I need to connect sftp server using above command and grep for some files and need to back to script can anyone tell me how to write script connectingSFTP.sh -------------------- sftpCmd=`sftp -v... (1 Reply)
Discussion started by: kittusri9
1 Replies

2. Shell Programming and Scripting

Passwordless SFTP

Hi, When Iam trying to do SFTP it is asking for password everytime. Can I have any alternative where I can provide the password in script itself. Because there are some control-M jobs which runs without user interaction. So please let me know the script where we can provide the password in the... (2 Replies)
Discussion started by: manneni prakash
2 Replies

3. Shell Programming and Scripting

passwordless authentication of SFTP script

Dear All I need to discuss about the problem which has been discussed so many times here. I need to transfer a file from server A to server B via passwordless SFTP script. By reading the threads on this topic here, I followed the below steps but still it's not working .. Pls find the steps... (13 Replies)
Discussion started by: uday.shankar
13 Replies

4. Shell Programming and Scripting

passwordless sftp with debug options

Hi, In our project we already have a passwordless sftp with -b (batchfile) option working but there have been some new application rolled out at the client site and they want us to raise the DEBUG option somebody suggested to use following options with sftp command -oLogLevel=DEBUG... (4 Replies)
Discussion started by: dips_ag
4 Replies

5. IP Networking

How to transfer files from UNIX server to windows machine or vice versa using ftp or sftp commands?

hi, i want to write a shell script code which transfers files from a directory in unix server to a directory in a windows machine.. can any1 give me a sample code which uses ftp or sftp command.. thanks very much, (3 Replies)
Discussion started by: Little
3 Replies

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

7. HP-UX

Connect to remote server using sftp with password define within command/script

I am trying to connect to remote server in hp-ux, using sftp command (using sftp username@ip and password ) able to connect to remote server but, in this case sftp prompt for password and user need to manually enter it. I want sftp can read a password define in script or from file, so it can... (1 Reply)
Discussion started by: ketanraut
1 Replies

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

9. UNIX for Beginners Questions & Answers

How to use passwordless sftp in script?

Hi I am trying to do SFTP in shell script in such a way that it should not ask for password. for this is use below script but it prompt for password. here I am not abled to understand where I am making mistake. #!/bin/bash # SFTP TO remote server USER="ITO" PASSWORD="abcd@1234"... (4 Replies)
Discussion started by: scriptor
4 Replies

10. UNIX for Advanced & Expert Users

Connect direct - SFTP - List of servers that I can connect

Greetings Experts, I am working for a bank client and have a question on connect-direct and SFTP. We are using Linux RedHat servers. We use connect-direct to transfer (NDM) files from one server to another server. At times, we manually transfer the files using SFTP from one server to another... (2 Replies)
Discussion started by: chill3chee
2 Replies
SFTP-SERVER(8)						    BSD System Manager's Manual 					    SFTP-SERVER(8)

NAME
sftp-server -- SFTP server subsystem SYNOPSIS
sftp-server [-ehR] [-f log_facility] [-l log_level] [-u umask] DESCRIPTION
sftp-server is a program that speaks the server side of SFTP protocol to stdout and expects client requests from stdin. sftp-server is not intended to be called directly, but from sshd(8) using the Subsystem option. Command-line flags to sftp-server should be specified in the Subsystem declaration. See sshd_config(5) for more information. Valid options are: -e Causes sftp-server to print logging information to stderr instead of syslog for debugging. -f log_facility Specifies the facility code that is used when logging messages from sftp-server. The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. The default is AUTH. -h Displays sftp-server usage information. -l log_level Specifies which messages will be logged by sftp-server. The possible values are: QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3. INFO and VERBOSE log transactions that sftp-server performs on behalf of the client. DEBUG and DEBUG1 are equivalent. DEBUG2 and DEBUG3 each specify higher levels of debugging output. The default is ERROR. -R Places this instance of sftp-server into a read-only mode. Attempts to open files for writing, as well as other operations that change the state of the filesystem, will be denied. -u umask Sets an explicit umask(2) to be applied to newly-created files and directories, instead of the user's default mask. For logging to work, sftp-server must be able to access /dev/log. Use of sftp-server in a chroot configuration therefore requires that syslogd(8) establish a logging socket inside the chroot directory. SEE ALSO
sftp(1), ssh(1), sshd_config(5), sshd(8) T. Ylonen and S. Lehtinen, SSH File Transfer Protocol, draft-ietf-secsh-filexfer-00.txt, January 2001, work in progress material. HISTORY
sftp-server first appeared in OpenBSD 2.8. AUTHORS
Markus Friedl <markus@openbsd.org> BSD
January 9, 2010 BSD
All times are GMT -4. The time now is 07:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy