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
267 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 78

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 78

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

Independent Software Vendors: 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

Suggested Solutions

Have you ever had a hard drive that you can't boot into, but need to change the registry? Here is the solution! This article guides you through accessing and editing a registry of a non-primary drive. To read registry information on a non-prim…
When it comes to security, there are always trade-offs between security and convenience/ease of administration. This article examines some of the main pros and cons of using key authentication vs password authentication for hosting an SFTP server.
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…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

734 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