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
262 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 76

Expert Comment

by:arnold
Comment Utility
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
Comment Utility

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 76

Accepted Solution

by:
arnold earned 500 total points
Comment Utility
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
Comment Utility

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
Comment Utility
ok
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Log files are useful in diagnosing and repairing problems.  This is a list of common log files and their standard locations that I've compiled.   While this is not exhaustive, it is a pretty good list that I've found to be useful.  I may update it f…
When you upgrade from Windows 8 to 8.1 or to Windows 10 or if you are like me you are on the Insider Program you may find yourself with many 450MB recovery partitions.  With a traditional disk that may not be a problem but with relatively smaller SS…
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…
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…

771 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

12 Experts available now in Live!

Get 1:1 Help Now