Solved

Windows login script for certain users to be in certain directory after ssh login & permission for directory access

Posted on 2011-09-18
5
265 Views
Last Modified: 2012-06-21

I sent my Linux .pub ssh key to a remote Windows Openssh server
administrator & this enabled me to ssh login to the remote Windows
server's command prompt (without being prompted for password).

Thing is currently all my ftp scripts' default directory after ftp login is d:\ftp\
(as set by the ftp server software on the remote-end Windows server).
But when I ssh into the server, the default directory is d:\Exchange.

Q1:
However, with conversion to sftp/scp, I found the home directory
is different & this requires my sftp/scp scripts to specify the full
path.  The home directory setting for the login id can't be changed
as Openssh expects to look for the ssh key in %HOMEPATH%\.ssh
& if it's changed it will affect other ssh users' public keys stored
in the Windows server.  So is there a script in Windows such that
after I ssh (or scp/sftp) into the remote Windows server, it will
automatically put in the desired directory ie d:\ftp

Q2:
I'm able to scp/sftp files from my Linux box to the remote Windows
server's d:\ftp\...  folder.  However, if I were to ssh into it, I can't
read nor list files there :

# ssh remote_id@Windows_IP_addr
D:\Exchange>cd \ftp
 
D:\ftp>dir
Access is denied.
 
What needs to be done to enable the ssh login to be able to list, read &
write files there?
0
Comment
Question by:sunhux
  • 3
  • 2
5 Comments
 
LVL 77

Expert Comment

by:arnold
ID: 36557449
The admin in ssh needs to grant your ssh user read permissions in the FTP dir.
i.e. currently is allows write, but does not allow read/execute access.


0
 

Author Comment

by:sunhux
ID: 36558120

But when I sftp'ed into the remote Windows server, I can issue "ls" or "dir" besides
writing to it but not when I ssh into it
0
 
LVL 77

Accepted Solution

by:
arnold earned 500 total points
ID: 36561449
The issue might be that ssh is configured as chrooted such that it can only access the home dir and can not traverse out.
Have the admin check the configuation.

What is being for ssh server on the windows system?
0
 

Author Comment

by:sunhux
ID: 36564364

ssh server on the Windows box is Openssh & it set bash shell for the Windows
login id.  Just found out that "ls" works, "cat ..." works but not windows commands
"dir" & "type" which gave permission denied.  Weird . . .
0
 

Author Closing Comment

by:sunhux
ID: 36911260
ok
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article covers how to install the Microsoft Windows Operating System (OS). What is covered in this article:  > Different Versions and Editions of the Windows OS  > Upgrading versus Fresh Installation of the OS           - Steps to take pr…
INTRODUCTION The purpose of this document is to demonstrate the Installation and configuration of the Data Protection Manager product. Note that this demonstration was prepared on the basis of Windows OS is 2008 R2 and DPM 2010. DATA PROTECTI…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
Viewers will learn how to properly install and use Secure Shell (SSH) to work on projects or homework remotely. Download Secure Shell: Follow basic installation instructions: Open Secure Shell and use "Quick Connect" to enter credentials includi…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question