Cloud9 (c9.io) SSH permission denied - cloud9-ide

We have been using Cloud9 pretty heavily hear at the shop. However today all of our workspaces on one of our servers are now inaccessible. If I try SSH Settings and go click on 'apply', I get this:
Error: {"connect":{"ok":false,"errmsg":"Cloud9 couldn't connect to SSH server [myusername]#[server_ip]","code":255,"stdout":"","stderr":"Warning: Permanently added '[my-ip]' (RSA) to the list of known hosts.\r\nPermission denied (publickey,gssapi-keyex,gssapi-with-mic,password).\r\n"},"ok":false}
The only think I can think that happened was permissions were changed on all the files within the folder this workspace was accessing to 777. Well almost all before it was realized what was done. Do permissions play a role in it? Just don't know what else it would be since one minute it was working and the next it was not. I did try deleting the workspace and recreating with no luck. (won't even create the space because it cannot connect anymore). I doubled check that the ssh key was still authorized. Any ideas? really need this up and running as we have pretty much become dependent on c9 to be or main tool.
thanks.

Turns out that it was a permissions issue. I had to change the user folder I was trying to connect to , to 711. Once we did that, everything is up and running.

Related

GIT Client on Windows Complaining about Ownership

With great difficulty due to my limited knowledge of Linux, I set up a GIT server on my Raspberry Pi. It works great except for one thing that's been driving me nuts. I've used every Google fu move I can think of and I've gotten nowhere.
I'm using Git Extensions as the client on 3 Windows machines. One at work (no problems) and 2 at home. The local repository at home is on a shared NAS drive on my LAN. It works fine on my main computer, but when I try to access it on my secondary computer, I get the following error:
warning: '//NAS/REPOSITORY' is owned by:
'S-1-5-...'
but the current user is:
'S-1-5-...'
where 'S-1-5-...' is two different really long alphanumeric strings that mean nothing to me. It says warning, but then whenever I try to do anything I immediately I get errors I can't decipher after that like:
fatal: this operation must be run in a work tree
or
fatal: No names found, cannot describe anything.
I'm the only user, using the same windows account, username, email address, etc. configured in Git Extensions. As I understand it on the server end, the only user is git which I use for all machines.
As a workaround, I'm able to clone the repository to a different folder on my secondary computer and I have no problems with GIT, but I have problems with my code because it expects things to be in a certain directory. I can change that based on the user, but as far as my code knows, I am the same user on both machines (because I am!). So that is not a good solution. I want to be able to work in the same folder on my NAS no matter what computer I'm using.
-Is there a way to configure GIT or GIT Extensions (I'm not totally sure who is doing the complaining) to not care about ownership? I've tried cloning as a Public Repository, but I guess that doesn't mean what it seems to mean because I get the same errors.
-How do I know and/or configure what user GIT or GIT Extensions thinks I am?

TortoiseGit asking for password on password-less login setup

After months of uninterrupted password-less work, my TortoiseGit started to ask me for a password on some of my remotes, when pushing / pulling. I'm seeking a solution to fix this, as this can drive me crazy.
To underline: I want to remain on SSH-based password-less login, so any solutions that assume adding password to URL or permanently storing password in TortoiseGit configuration is not an option for me.
What I found out so far:
My problem is not related to GitHub; I don't use it in TortoiseGit and it happens on other remotes.
I do have SSH, not HTTPS, address as repo's URL and I don't have git clone-like stuff in it.
I can push/pull the same repository using Netbeans (and my Netbeans has Select Configured Git Repository Location option checked, so it uses the same remote configuration).
I can't push/pull remote using Git GUI, reason the same: asking for user password.
This is not related to a particular system or machine (SSH key), as it happens on both my work computer (32-bit Win 7) and home one (64-bit Win 7). Both of course uses different SSH key (see comment to this answer, which claims, that problem is related to 32-bit version of Windows; this is not true, it happens on 64-bit Windows as well).
Repository, this happens on, isn't empty -- I heard and even been personally affected, that sometimes TortoiseGit gets wako and asks for password on password-less login remote, until that remote is empty.
This is not related to a particular remote -- TortoiseGit works fine, without asking for password on some repositories (i.e. BitBucket) but "dies" asking for it on some other (i.e. in local dev network).
To make things even worse, there are certain remotes, on which TortoiseGit on my home computer fails, asking for password, while the very same remote accessed from home computer works just fine. And vice-versa. I set both machines for password-less login using the same steps; only SSH keys differs.
Things I did so far (and didn't solve the problem):
Changing SSH client (TortoiseGit -> Settings -> Network) to both Git\bin\ssh.exe (as suggested in here) and to C:\Program Files\PuTTy\plink.exe.
Using credential helper doesn't helped and I heard that it works for HTTPS only, not for SSL.
Downloading git-credential-wincred.exe and putting it to Git for Windows / msysgit folder didn't help as well; I've already had it there (different version / filesize; checked on both).
This issue is clearly bind to asking for user password, so git did not exit cleanly (exit code 128) error following it doesn't have any other source except missing password and most solutions given here, like crashed git, locked file, missing user e-mail are not solution for me.
OK, that's the farest point I've reached. And still nothing. Can anyone come up with something new, that I should try to solve this issue?
I confirm that "storing password" or _netrc file, or any credential helpers are for https url only, and have nothing to do with SSH.
The usual debugging ssh steps apply, starting by making sure that %HOME% is defined when TortoiseGit is launched, and %HOME%/.ssh exists, and contains the default keys id_rsa and id_rsa.pub.
In a git bash session, you can do a ssh -Tvvv yourRemoteServer to see what the debug error message sequence is, as explained here.
You also can check the result of a GIT_TRACE=2 git push test master, to see if the issue is limited to TortoiseGit and if the verbose output leaves any clue (see here).
Try switching ssh client between putty and openssh to see if TortoiseGit fairs better with one or the other.
The issue appeared yesterday and it took me 2-3 hours of trying all sorts of stuff to fix it. I also contacted server administrator, who claimed not to have done any changes in config in the past days. Hence I put bounty on this question. I also gave it a try today, but still negative. Finally, right now, I made another attempt just to copy the message to my friend, and, all of the sudden, all my repos started to work!
I am absolutely sure I didn't touch configs, it must have been some sort of timeout which took more than 16 hours. I have no idea what the problem was. All I can conclude is that waiting till the next day might help...

MobaXterm drag-and-drop panel missing

I need to run a program from my windows xP machine thats installed on a remote UNIX machine using MobaXterm but I have very little experience with this sort of thing.
I can login into the machine using ssh and start the program without a problem. That program needs files that I have on my windows computer to process though and I want to copy them over to that remote machine. Unfortunately the drag-and-drop file transfer panel that is mentioned regularly on mobaxterm help sites isn't present and I can't figure out how to make it appear.
Could someone suggest how to get that drag-and-drop panel to appear please? I'm using MobaXterm version 3.0.
Alternatively any explanation on how to transfer these files another way would also be very much appreciated.
Thank you very much for any help you can give.
If it still doesn't work when you try all of above methods, try this:
when you creat a Session, change the Advanced SSH setting-->SSH-browser type to SCP, which default is SFTP.
. thanks to willfurnass
Some Linux distributions or some other Unix systems have disabled SSH password authentication by default.
In order for MobaXterm to be able to launch the SFTP browser, you will have to re-enable this feature:
Edit the "/etc/ssh/sshd_config" file on your server, and comment the following line:
PasswordAuthentication no
Restart your SSH server using the following command: /etc/init.d/sshd restart
Connect using MobaXterm SSH client and you will notice that the SFTP tab will be correctly launched.
If you can not modify your remote server configuration, you can also perform your file transfers inside MobaXterm terminal using SCP. A sample SCP command would be:
scp -r /drives/c/Some/Place/On/Your/Local/Windows/Drive/ yourlogin#yourserver:/Some/Place/On/Your/Remote/Unix/Server/
Ensure you have "Display SFTP Browser" enabled in your session settings under "Advanced SSH settings".
Occasionally it doesn't reappear, which is solved by a restart MobaXterm.
Another cause for the lack of sftp panel is if you accidentally enter and store a bad sftp password. MobaXterm then appears to attempt an automatic log in, but silently fails to open the sftp connection.
To fix this, go to Settings>MobaXterm passwords management and delete the offending password. Here's a screenshot of the settings page, showing the password management link.
To be clear, I had already run through the settings mentioned by #Nicolas and #Didier (thanks, guys!). I was able to get the sftp tab when ssh'ing in to other hosts (which didn't have bad passwords stored). And I had in the past seen the sftp pane. This fix solved my problem.
If you've never seen the sftp pane, then try the other suggestions first.
Have you tried:
Turning the program off and on again?
Note: I read this hint in a comment, which saved me from a tidious process of unnecessary fixing mobaXterm, also I am hence not the only one with that behavior. Even though this might be the first thing you already tried, some might not have been trying and haven't been lucky enough to read through the comments - this is for them.
For the most recent versions, ensure you have selected 'SFTP protocol' in the'SSH-browser' selector:

XCode, Git and MediaTemple (gs)

I'm wondering if anyone's managed to connect to a self-hosted Git repository on a Mediatemple GridServer (gs) via XCode? I tried setting this up last night, and this is as far as I've got:
Installed Git on my Mac(s)
Created subdomain for git (git.blahblah.com) on my gs service via Terminal SSH
Created empty repository within subdomain (git.blahblah.com/repo/repo.git) via Terminal SSH
Clicked on 'Connect to repo' from XCode's launch menu
Entered repo address (ssh://git.blahblah.com:22/repo/repo.git) in XCode's address bar
Clicked 'clone' once XCode has found the repo and is telling me that "Authentication [is] required"
Chosen the appropriate local folder on my machine to clone the repo to
Tried to enter username and password specified in MT admin panel - the same ones that I used via Terminal SSH to set up the repo in the first place
Get booted with an error message: either 'incorrect username and password' (they're not) or 'specified address does not appear to be a repository, connection unexpectedly terminated by host' (or similar)
Cry. Repeatedly.
Getting to step 6 causes my IP to be blocked by MT, even if I'm logged into the web control panel from the same IP at the same time. Unblocking the IP via the MT control panel has no effect; the IP is blocked as soon as I try and connect via XCode again.
I suspect it's actually step 4 that's causing problems as XCode is trying to 'ping' the repo without credentials as you type in the address (to resolve connectivity).
Has anyone got this working, or do I need to look at hosting my Git repos elsewhere? I'd rather not spend more money on hosting when I have a service that should suit this purpose sitting unused.
After several online sessions with MediaTemple support I've come to the conclusion that it's not going to work.
While I can host a repository on my own gs service just fine, the way that XCode tries to connect to it causes my IP to be blocked every single time. As the blocking is automatic (and can't be turned off) then it seems XCode and MediaTemple have reached an impasse.
It's not a huge issue as I'm the only developer on this project, and I can always use DropBox instead (I was just trying to find a better way of keeping versioned backups across my laptop and desktop). If I really need Git I can use another tool or Terminal.
If I had to point fingers, I'd blame XCode: it seems its support for Git is rather sketchy beyond connecting to an open, gitHub-hosted repository.
Quick update: the solution I've managed to get working is to set up an account on BitBucket, create a project and add it to local Git, commit that to BitBucket and then connect to BitBucket using XCode. I downloaded SourceTree for extra Git activity as per Stefan's suggestion, as I'm still not 100% comfortable using Terminal (I just like GUIs, is that wrong?).
Everything seems to be running smoothly so far; it's just a little annoying that I had to use a third party for Git when I thought my server (which I'm already paying for) could do the job.

Programatically syncing a web project to a Linux server

I have an old web project that gets rsynced to some Ubuntu box using a little script. I'm planning on using Fabric for my deployment but one thing that always bothered me - and won't be different when using Fabric - is that I never got my file access rights right.
So - I'm rsyncing all that project stuff using a different user then the one who's running the project (and of course needs at read/write access for these files) so I'm ending up with new files being created that can only be accessed by the sync-user and not by the project-user. I guess when I'm using Fabric I could "fix" the rights after syncing - so the project-user can read them - but I'm wondering if I got the problem wrong in the first place.
Maybe this isn't a problem with the scripts or the syncing but just some file access rights problem? Since I don't do Linux all day I guess that's an option. :)
I hope I could clearly state my problem. Any ideas?
Only privileged process can set owner of files it can set user id of files it creates to any other than their own.
I don't think it's reasonable to run rsync privileged from security point of view, so you have to run the synchronization as the project user.

Resources