This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Issue Setting up SFTP/OpenSSH on Multiple PLatforms


Sorry didn't proofread and had bad cut & paste

Step 3 -- Log out of Windows and generate the key pair on the MAC if necessary, not Windows

Step 5 should be
ssh myuser@windows_machine
cd ~/.ssh
cat id_rsa-MACmachinename.pub >> authorized_keys
chmod 600 authorized_keys


-----Original Message-----
From: Gluszczak, Glenn 
Sent: Thursday, January 28, 2016 10:43 AM
To: cygwin@cygwin.com
Subject: RE: Issue Setting up SFTP/OpenSSH on Multiple PLatforms



I never got ssh-copy-id to work from Linux to Windows and couldn't be bothered tracing it.
At first, the key was going to the Windows user's home directory -- C:\users\myuser Thereafter there might have been a path issue as /home/myuser equates to C:\cygwin\home\myuser.
But ssh-copy-id doesn't do very much.

1) You probably know this, but check the usernames are the same on both machines.

2) On Windows, ensure the home directory for your user is /home/myuser in /etc/passwd.
You can verify it is working by seeing which directory you are at when you login

ssh myuser@windows_machine
pwd

2)  Once you have done that, from the remote machine (MAC), log in as myuser and cd ~/.ssh (~ is the users home directory).

3) You should have an id_rsa.pub public key.  If you don't, generate a key pair using ssh-keygen -t rsa -b 4096 -C "myuser@MACmachinename"

4) scp id_rsa.pub myuser@windows_machine:.ssh/id_rsa-MACmachinename.pub

5) ssh myuser@windows_machine
cd ~/.ssh
cat myuser@windows_machine:.ssh/id_rsa-MACmachinename.pub >> authorized_keys chmod 600 autohorized_keys

6) logout and test
ssh myuser@windows_machine






-----Original Message-----
From: Brendan Maloney [mailto:maloneybw@tamug.edu]
Sent: Wednesday, January 27, 2016 4:47 PM
To: cygwin@cygwin.com
Subject: RE: Issue Setting up SFTP/OpenSSH on Multiple PLatforms

I'm using ssh--copy-id which should do the same thing but I keep getting a "permission denied" error after I enter my password.  I read up on this a little and did a chmod 0700 /home/user/.ssh to make sure permissions on that folder were right but it still didn't work.  Would doing it using the "cat" method be any different?  Can you provide syntax for this?  I'm trying to find a guide for this that shows me what command to use to do it but maybe after messing with this stupid server for so long Google has stopped being my friend.

Brendan 

-----Original Message-----
From: Gluszczak, Glenn [mailto:glenn.gluszczak@emc.com]
Sent: Wednesday, January 27, 2016 3:06 PM
To: Brendan Maloney <maloneybw@tamug.edu>
Subject: RE: Issue Setting up SFTP/OpenSSH on Multiple PLatforms

Cat your id_rsa.pub from the remote machine into ~/.ssh/authorized_keys.  Also need to ensure permissions on files are correct.

I have numerous Unix/Linux machines working with cygwin.  Should be no different for MAC.

-----Original Message-----
From: Brendan Maloney [mailto:maloneybw@tamug.edu]
Sent: Wednesday, January 27, 2016 4:01 PM
To: cygwin@cygwin.com
Subject: RE: Issue Setting up SFTP/OpenSSH on Multiple PLatforms

Ok I fixed the problem with not being able to connect from my mac systems.  I had to change a bunch of permissions that I found in a different setup guide and it started working.  I can use ssh and sftp from command line as well as Filezilla although it doesn't seem to recognize my default path like it does from my windows systems, but I think I can hack my way around that in the script by just using some different CD commands.  So the problem I'm having now is that I'm trying to get public/private key authentication working.  I've used ssh-copy-id from my mac though I'm not sure I'm using it right but I'm not sure what I need to do on the Cygwin side.  The key seemed to copy over to a random folder and I moved it to ~/.ssh thinking this is where it should go but every time I try to use SFTP from the command line it still prompts me for my password so the key authentication is obviously not working.

Brendan

-----Original Message-----
From: cygwin-owner@cygwin.com [mailto:cygwin-owner@cygwin.com] On Behalf Of Bob Coho
Sent: Wednesday, January 27, 2016 10:08 AM
To: cygwin@cygwin.com
Subject: Re: Issue Setting up SFTP/OpenSSH on Multiple PLatforms

Brendan,

Is your Windows server running Windows 10? I had a similar issue and installing Openssh 7.1p1-1 solved this issue.
Openssh 7.1p2-1 had no issues with Windows 7 or XP, but I could not get it to work with Windows 10. I don't have access to a Windows 8 environment so I can't say if it will work or not.

-----Original Message-----
From: Brendan Maloney
Sent: Tuesday, January 26, 2016 6:33 PM
To: cygwin@cygwin.com
Subject: Issue Setting up SFTP/OpenSSH on Multiple PLatforms

I've done this once before (Prior to the posix user release of openssh) and I had no problems setting up SFTP on a windows server.  Now I'm trying to do it again and I'm running into nothing but weird problems.  I followed the normal package installation and ran the ssh-host-config installer which seemed to run fine.  Inititially I thought the POSIX change for users would be great except that this is a domain machine and it allowed all of my domain users access to SFTP when I only wanted that access available to the local users I specified.  Going back to my roots I created the /etc/group 
and /etc/passwd files to manage my user accounts.   Now here is where it 
starts to get weird.  By default now the users populate the passwd file as <servername>+<username>.  When it's configured like this I cannot successfully connect via sftp (I'm using Filezilla) to the server.  What I ended up having to do was manually edit the file and take out the "<servername>+" of the passwd file for the users I wanted to have access. 
Now I can login to the server successfully, but weirdly enough this ONLY works on a PC.  I'm also trying to get a mac to connect (also using
FIlezilla) and it won't connect at all.  I've also tried just using the sftp command line tool in os x and it just immediately drops the connection. 
Ultimately I'm trying to get some scripts migrated from running FTP on this server to running SFTP.  I'm using psftp on the windows machine which works just fine (same as filezilla does) and it's able to run my batch script just fine.  I was trying to do the same thing on the mac by using the sftp command and setting up public/private key authentication (which I still haven't figured out partly because I'm obviously having these other issues with the connection in the first place so it's really hard to test.  It would be great if there were some kind of log file on the Cygwin server so I could see what was failing when the macs try to connect to SFTP and the PCs connect successfully.  I realize this is a lot but I'm not sure who to ask anymore and I'm really lost.  I'm just a Systems Analyst and I don't work doing this kind of stuff everyday.it was just something I got tasked with doing because I have the most linux/mac experience of anyone in my department which after this little escapade feels like pretty much zero.

Thanks in advance for the help

Brendan

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple 


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]