Good tool to manage ssh tunnels on OSX [closed] - macos

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I'm looking for a good tool to manage ssh tunnels. Currently I'm using SSHTunnel (cocoa-sshtunnel) but its not very secure, if you look at a ps while connected you see the password in plaintext. And there is no way to configure a private key file per connection.
I also tried STM (http://projects.tynsoe.org/en/stm/index.php) however you cannot save your passwords, and also no private key option.
I'm working on osx Snow Leopard. I use the tunnels for Remote port forwarding. I have a local SVN server for website development, and checkout remotely. I cannot forward ports as I don't have access to the router.
What tools do you use?

SSH Tunnel Manager - This tool is great!

you should use the console and normal ssh for tunneling, at least thats what i always do. here a small introduction on how to use it. password saving is indeed something that doesn't work there but i always used keys anyway so you don't have to enter a password anymore
ssh tunnel from console:
http://www.revsys.com/writings/quicktips/ssh-tunnel.html
login with authkeys:
http://linuxproblem.org/art_9.html
this is both for linux and bsd but should work on mac os too, i remember using it there maybe some option has another shortcut, if it doesn't work look at man ssh
*EDIT
if you need a gui (comment) try jellyfissh seems it can do what you need
http://www.m-works.co.nz/jellyfissh.php

I wrote my own tool for this, Tunnel Boring Machine. It doesn't store passwords, but it works fine with SSH keys in ~/.ssh, which is how I use it.
It's possible that I'll get around to password storage at some point -- if you end up finding that TBM works for you but is missing some key feature like password storage, feel free to file an issue on GitHub, or, for that matter, implement it and send me a pull request.

I use Terminal for this and it works very well. You could create a shell script for your colleagues that sets up the tunnels with their username as an argument. That should be simple enough for them to run? For example:
#!/bin/sh
username=$1
servdest=ssh.yoursshserver.com
ssh -l ${username} -L 7777:${servdest}:7777 -L 2112:wiki.elsewhere.net:80 ${servdest}

Related

Creating an easily-distributable dev environment - Docker/Vagrant? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I'm trying to figure out how to go about making an easy way to distribute a "dev environment" for working with my organization's Wordpress site. We currently have a local Linux server running the Wordpress site, and a VirtualBox image that is horribly out of date and a very poor representation of this server. We currently distribute this to team members for their local development, which causes lots of problems as the local image is often too different.
I'm not too worried about the database aspect of things; I'm thinking of just doing weekly dumps from the live server which can be imported by developers to keep their local up to date.
I'm more interested in finding an easy to distribute a preconfigured stack to users on OSX or Windows that already has PHP/Apache/MySQL configured by me, a git client set up to pull all the static files on command--something the user can just run, then go to localhost:8000 to see it. I'd also like some way for them to edit the files that were pulled from the git repository.
I'm currently looking into Docker and Vagrant but I'm not sure what's more appropriate for this task—Docker seems like it would be more suited to Linux machines. I know Vagrant supports mapping external folders into the VM, which seems like it'd solve my problem, but I wanted to ask for more suggestions before I start learning Chef/Puppet/etc.
I think both Vagrant and Docker may be used to solve your problem.
Vagrant may be more adequate to share the environment with Windows/mac machines, but integration with Docker in these systems are better day-by-day using tools such as boot2docker.
Docker by contrast requires using a moder Linux Kernel or one of these tools.
If I had to develop the Vagrant option, I would setup a machine with all the dependencies installed in the same machine. To install you can use one of the provisioners available in Vagrant (e.g.: Chef, Puppet). This may be easier if you have previous experience with them and/or if you are not very keen on bash. There are a lot of examples you can check to see how you can do it, such as https://github.com/r8/vagrant-lamp
Using Docker is also a very good option. Answering your question, you can share any local folder of the host machine with a container (using the docker run option -v or --volume). In this case I would run each of the services you want to provide (i.e.: php server, MySQL, Apache..) as independent containers, and linking them using the docker run option --link. Programming your Dockerfiles to build this containers may result more difficult than if you were using Chef or Puppet (although you could use them to build the containers, the integration is not as good as with Vagrant). But with Docker you can take advance of all the apps ready to use you have available in the Docker Hub. Also I would recommend you a docker tool called fig (www.fig.sh) that let running a container cluster linking and configuring the services easily, and it's allow to manage all the containers in a very comfortable way. Again you can find very illustrative examples of this user case over the internet, as for example https://github.com/kasperisager/phpstack

Is "run as an adminstrator " the highest level? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I'm currently using a tool to modify hosts file ,and it said i should run it as administrator to replace hosts file, and i did so.
but ,it still failed.
And when i manually copy hosts file to etc folder, Windows will also ask me to provide administrator permission to copy to the folder.
This refresh my opinion about Windows administration.I also have wrote some programs that need to be run as administrator, and it works fine,i never though there is something you can't do even run as administrator.
So,if "run as administrator" isn't the highest level, how could a application request a higher level?(eg. replace hosts file on my computer)
Here is what i found after posting this question:
1.Thanks guys below, your opinions inspired me.
2.It's surely not related to safe mode.
3.I manually right click on the host tool and select "run as administrator", it works!It can replace the hosts file!You guys can try it,if you run notepad as administrator, it will also can write to hosts file.
so,here is what i guess:
The system do have two administrator level.
When double click on the my hosts tool, it only requires the lower level of administrator,so it failed to replace hosts file.
But manually right click and run as administrator, the system will give the tool highest level,and it can replace hosts file.
Explorer.exe only have a lower administrator level even you log in as administrator.That's why I need further permission when i paste hosts file manually.
What you did,I was trying to achieve the same manually,but I also faced the same situation. Actually,going into the permission related section,you will find that there are 3 users/groups at least assigned to each system :-
System
Administrator(includes all those accounts which are admin)
the logged in user-account.
So,basically,what Windows does I guess is that it takes special care about the systems file like C:/Windows/System32/driver/etc/hosts.file is a system-configuration related file which looks for mapping the hostnames to IP-Addresses!
The hosts file is one of several system facilities that assists in
addressing network nodes in a computer network. It is a common part of
an operating system's Internet Protocol (IP) implementation, and
serves the function of translating human-friendly hostnames into
numeric protocol addresses, called IP addresses, that identify and
locate a host in an IP network. // Taken from Wikipedia
Hence,you need to have a special permission for editing or configuring hosts file like editing it in safe mode. Though default settings are those which I mentioned, you can always manually configure the permissions.
But,the one line answer to your question is
Yes,System Configuration Files aren't editable manually by default,either they need editing to be done only if Windows is running in Safe Mode,or you need to change the settings manually for your administrator account...

Copying a local file from Windows to a remote server using scp [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
I try to transfer a folder of files from my local computer to a server via ssh and scp. After getting sudo privileges, I'm using the command as follows:
scp -r C:/desktop/myfolder/deployments/ user#host:/path/to/whereyouwant/thefile
However, I get the following error:
ssh: C: Name or service not known
I'm guessing it is due to my syntax for C:/desktop etc. Any ideas?
BTW I'm using putty + Windows 7.
If your drive letter is C, you should be able to use
scp -r \desktop\myfolder\deployments\ user#host:/path/to/whereyouwant/thefile
without drive letter and backslashes instead of forward slashes.
You are using putty, so you can use pscp. It is better adapted to Windows.
Drive letters can be used in the target like
scp some_file user#host:/c/temp
where c is the drive letter. It's treated like a directory.
Maybe this works on the source, too.
On windows you can use a graphic interface of scp using winSCP. A nice free software that implements SFTP protocol.
I see this post is very old, but in my search for an answer to this very question, I was unable to unearth a solution from the vast internet super highway. I, therefore, hope I can contribute and help someone as they too find themselves stumbling for an answer. This simple, natural question does not seem to be documented anywhere.
On Windows 10 Pro connecting to Windows 10 Pro, both running OpenSSH (Windows version 7.7p1, LibreSSL 2.6.5), I was able to find a solution by trial and error. Though surprisingly simple, it took a while. I found the required syntax to be
BY EXAMPLE INSTEAD OF MORE OBSCURE AND INCOMPLETE TEMPLATES:
Transferring securely from a remote system to your local system:
scp user#remotehost:\D\mySrcCode\ProjectFooBar\somefile.cpp C:\myRepo\ProjectFooBar
or going the other way around:
scp C:\myRepo\ProjectFooBar\somefile.cpp user#remotehost:\D\mySrcCode\ProjectFooBar
I also found that if spaces are in the path, the quotations should begin following the remote host name:
scp user#remotehost:"\D\My Long Folder Name\somefile.cpp" C:\myRepo\SimplerNamerBro
Also, for your particular case, I echo what Cornel says:
On Windows, use backslash, at least at conventional command console.
Kind Regards.
RocketCityElectromagnetics
You can also try this:
scp -r /cygdrive/c/desktop/myfolder/deployments/ user#host:/path/to/whereyouwant/thefile
I have found it easiest to use a graphical interface on windows (I recommend mobaXTerm it has ssh, scp, ftp, remote desktop, and many more) but if you are set on command line I would recommend cd'ing into the directory with the source folder then
scp -r yourFolder username#server:/path/to/dir
the -r indicates recursive to be used on directories
Drive letter can be used in the source like
scp /c/path/to/file.txt user#server:/dir1/file.txt

What is SSH forwarding?

I read a guide. It says that run the following line and forget it.
/usr/bin/ssh-add -K
I am not sure when and where I should use it.
What is SSH forwarding?
Here's an explanation. And another. An "illustrated" one.
Those should give you a general idea of what's going on here.
If you don't know why you need it, you won't need to add it to set up your ruby environment.
Note to others: this is a question relating to setting up his dev environment before people demand it is closed.
That seems to be a Mac OS X specific option to ssh-add. It adds identities to your OS X keychain, so that any later use will already have them handy.
This is different from other kinds of forwarding. My typical use is to do normal ssh-add with no extra options, then ssh -A to forward the agent. Meaning that if I ssh to another host through the first one, my creds are automatically passed on. Very handy.
By far your best bet is to read the manual pages for any options you see used. Ssh comes with great man pages.

What are some good SSH Servers for windows? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
Trying to setup an SSH server on Windows Server 2003. What are some good ones? Preferably open source. I plan on using WinSCP as a client so a server which supports the advanced features implemented by that client would be great.
I've been using Bitvise SSH Server and it's really great. From install to administration it does it all through a GUI so you won't be putting together a sshd_config file. Plus if you use their client, Tunnelier, you get some bonus features (like mapping shares, port forwarding setup up server side, etc.) If you don't use their client it will still work with the Open Source SSH clients.
It's not Open Source and it costs $39.95, but I think it's worth it.
UPDATE 2009-05-21 11:10: The pricing has changed. The current price is $99.95 per install for commercial, but now free for non-commercial/personal use. Here is the current pricing.
I agree that cygwin/OpenSSH is the best choice, but its setup can be involved to say the least. Here is a document to get you started though: Installing OpenSSH
I've been using Bitvise SSH Server for a number of years. It is a wonderful product and it is easy to setup and maintain. It gives you great control over how users connect to the server with support for security groups.
copssh - OpenSSH for Windows
http://www.itefix.no/i2/copssh
Packages essential Cygwin binaries.
OpenSSH is a contender. Looks like it hasn't been updated in a while though.
It's the de facto choice in my opinion. And yes, running under Cygwin is really the nicest method.
VanDyke VShell is the best Windows SSH Server I've ever worked with. It is kind of expensive though ($250). If you want a free solution, freeSSHd works okay. The CYGWIN solution is always an option, I've found, however, that it is a lot of work & overhead just to get SSH.
You can run OpenSSH on Cygwin, and even install it as a Windows service.
I once used it this way to easily add backups of a Unix system - it would rsync a bunch of files onto the Windows server, and the Windows server had full tape backups.

Resources