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
268 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 79

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 79

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

My purpose is to describe the basic concepts of virtual memory as implemented in a modern Windows-based operating system. I will also describe the problems inherent in older systems and how virtual memory solves them. The dark ages - before virtu…
Many times while working on a computer regardless of any Operating System, lag and crashes seem to creep in, hindering your working speed. Sometimes, it can also cause your work to be lost unexpectedly and as a result, you are unable to meet your de…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
Suggested Courses

623 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