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
264 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

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…
Secure Shell (SSH) is a network protocol for secure data communication, mainly used to administer remote Unix / Linux servers via command line. But it also allows the user to open a secure tunnel between a client and a server where he can send any k…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
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…

813 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now