NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform. You will still be able to view content, but posting and replying will be temporarily disabled.
We're excited to launch our new Community experience on July 30 and more information will follow soon.
Stay connected during the transition - Join our Discord community today.

Network and Storage Protocols

Issue with sftp accessed by local users in /etc/passwd

khcchen
7,707 Views
Hi all,

I am having issue to access  /etc folder using SFTP for adminitration purpose.

The controller is runing 7-mode 8.1.4p1 with NFS licensed and I used the following page as guidance
https://kb.netapp.com/support/index?page=content&id=1012617

However, when I tried to connect to the controller by WinSCP/Filezilla, the storage console returned the following messages, and then SFTP connection creation failed.
[controller01: sshd_1:error]: error: Disconnecting: SFTP connection creation failed
[controller01:sftp.connection.setup.failed:error]: SFTP (SSH File Transfer Protocol) connection (#72) from client system xx.xx.xx.xx, user sftpuser failed. Reason: Homedir not set

In /etc/passwd, I have created a new sftpuser and specified the the homedirectory  /etc:

Also checked by getXXbyYY getpwbyname_r
pw_dir = /etc

sftp settings..
options sftp.auth_style unix
options sftp.dir_override (null)
options sftp.enable on

ssh.enable on
ssh1.enable off
ssh2.enable on


All other controllers are working...except this one, I tried to compare the settings, re-configured SFTP, created new sftp users, sftp.dir_override directory, but none of them works.

Thanks in advanced.
6 REPLIES 6

aborzenkov
7,697 Views

What is in your nsswitch.conf? Is filer set to uset /etc/passwd for users and in which order?

khcchen
7,670 Views

Hi aborzenkov,

 

rdfile /etc/nsswitch.conf

 

hosts: files        nis    dns

passwd: files     nis    ldap

netgroup: files  nis   ldap

group: files       nis    ldap

shadow: files     nis

 

 

 

rwelshman
7,640 Views

I think the home directory should be set to /vol/vol0/etc  ?

khcchen
7,634 Views

Hi rwelshman

 

I tried different paths in the /etc/passwd file under different user names..but unfortunately...all failed

 

/

/etc

/vol/vol0/etc

rwelshman
7,597 Views

have you tried setting the sftp.dir_override option to /vol/vol0/etc?

khcchen
7,583 Views

I tried the following settings, but all failed.

sftp.dir_override           /

sftp.dir_override           /vol

sftp.dir_override           /vol/vol0

sftp.dir_override           /vol/vol0/etc

 

Done further checking on the sftp log (/etc/log/sftp.cmd), it seems like the path is set to /vol/vol0, instead of  /vol/vol0/etc

Ptype          SSH_FXP_INIT Version 3

Ptype SSH_FXP_REALPATH Id 256 Path /vol/vol0

 

Did I miss anything?

Public