Five easy to use secure shell clients. Which makes the remote copying of files much more secure than standard ftp. Mac, or Windows there is an easy to use secure shell client to handle. The Best Tech Newsletter Anywhere. Join 250,000 subscribers and get a daily digest of news, comics, trivia, reviews, and more. 250,000 subscribers and get a daily digest of news, comics, trivia, reviews, and more. Remote-shell protocols traditionally work by conveying a byte-stream from the server to the client, to be interpreted by the client's terminal. (This includes TELNET, RLOGIN, and SSH.) Mosh works differently and at a different layer. Apple Remote Desktop also gives you the power to execute UNIX shell scripts or commands on your remote client systems. You can view either a summary or the complete results of the command’s output. This lets you script many standard functions built into UNIX systems or third-party tools. WinSCP is a free SSH file transfer and remote execution client with powerful scripting capabilities for Windows. Download now. Secure Shell Secure Shell. SSH community. SSH (Secure Shell) home Download free SSH clients SSH key management. Products Products. Other SSH clients can be found here. WinSCP for Mac.
Active2 years, 10 months ago
I would like to drop into the mongo shell in the terminal on my MacBook. However, I'm interested in connecting to a Mongo instance that is running in the cloud (compose.io instance via Heroku addon). I have the name, password, host, port, and database name from the MongoDB URI:
I have installed mongodb on my MacBook using Homebrew not because I want Mongo running on my Mac, but just to get access to the mongo shell program in order to connect to this remote database.
However, I can't find the right command to get me the full shell access I would like. Using instructions found here http://docs.mongodb.org/manual/reference/program/mongo/ (search for 'remote') I am able to get what looks like a connection, but without giving my username or password I am not fully connected. Running jononomojononomo
db.auth(username, password) returns 1 (as opposed to 'auth fails' when I provide incorrect username and password), but I continue to get an 'unauthorized' error message when issuing the show dbs command.
5,6511818 gold badges6666 silver badges124124 bronze badges
2 Answers
You are probably connecting fine but don't have sufficient privileges to run
show dbs .
You don't need to run the db.auth if you pass the auth in the command line:
Once you connect are you able to see collections?
If so all is well and you just don't have admin privileges to the database and can't run the BenBen
show dbs Desktop client for mac.
6,96966 gold badges1919 silver badges2525 bronze badges
With Mongo 3.2 and higher just use your connection string as is:
Amio.ioAmio.io
10.1k77 gold badges4949 silver badges8484 bronze badges
Not the answer you're looking for? Browse other questions tagged mongodbmongo-shell or ask your own question.
Please consider supporting Scripting OS X by buying one of my books!
What is SSH?
SSH is short for ‘Secure SHell’. It is a protocol that allows you to open a shell (terminal session) on another remote computer over the network. On macOS you will usually initiate an SSH session with the Terminal application, though there are other third party applications for macOS and iOS that support the SSH protocol as well.
On macOS SSH access is sometimes called ‘Remote Login’.
As the name implies, connections over SSH are encrypted and secure. This may not seem unusual today, but it did replace many unsecured protocols such as
telnet and rlogin .
SSH is supported on many platforms. You can use SSH to connect to Macs as well as any other computer which supports SSH and has it enabled. Of course, when you SSH to a different system, the environment you get through SSH might be very different (i.e. not
bash , different commands, etc.), so be sure you understand the remote system.
Enable SSH access
By default SSH access is disabled on macOS. Before you can connect to a Mac with SSH you need to enable access. In the UI you can do this in System Preferences > Sharing, by enabling the ‘Remote Login’ option. Here you can also control whether all users on the Mac can get SSH access or just some of them.
The Sharing pane will also show the current hostname of this computer:
You can also enable SSH access from the command line with https://mojobrown610.weebly.com/enterprise-vault-client-for-mac.html.
and turn it off again with
Turning SSH off with this command helpfully reminds you that if you are currently connected remotely, you will disconnect with this command and have to login locally to re-enable. To override this helpful notice, you can add the
-f option:
And if you want to know which hostname a Mac thinks it is, use the
hostname command:
Note: If you want to control which users have access with a script, I have an example in this post. This post was written for Munki but should be fairly easy to adapt to other systems.
Connect with SSHRemote Control For Mac
To connect to a machine from another Mac (the one you are working on) is simple enough. Open Terminal and enter:
or alternatively (different syntax, same result, which one you prefer is a matter of taste)
If you do not give a
username , ssh will use the short name you are currently logged in as. That is a useful shortcut if the username is the same on both systems.
When you connect to a remote machine for the first time you will get this prompt: https://mojobrown610.weebly.com/irc-client-for-mac-os-x-lion.html.
(Your actual fingerprint will look differently.) This prompt tells you that your
ssh does not recognize this host and gives you a chance to not connect. For now, type yes to confirm. This will add the host to the list of known hosts, so the prompt will not return when you connect again. We will discuss keys and security in a later post.
Remote Shell Client For Mac Os
Next
ssh will prompt you for the password on the remote computer. Once you enter that you will get the prompt and have a secure shell to the remote computer. Any command you enter now, will be run on the remote computer.
You can connect with
ssh when no user is logged in, i.e. the Mac is sitting at the login window. You can even connect with one user, while a different user is logged into the Mac with a UI session. In these cases, commands that interact with the UI, will fail, since the UI is either not running, or running as a different user. Most common examples are open and osascript (AppleScript).
If you happen to be logged in on the same Mac with the same user, then the command will work, but
open will open and display the Finder window on the remote Mac, not the Mac you are working on, which can be confusing.
Ending it
To end the remote session, just use the
exit command.
This will return you to the shell on your Mac where you executed the
ssh command.
SSH Shortcut Files
If you frequently connect to certain hosts you may want to create an ssh short cut file, which you can then just double click or invoke with spotlight.
Remote For Mac DownloadExecute Just One Command
Instead of opening a remote shell you can use
ssh to just execute just a single command on the remote host:
The
ssh command will prompt for the password and the print the output of the command from the remote machine. This can be very useful. You can combine multiple commands with ;
In some case the command you want to execute remotely can prompt for information, usually a password. You can add the
-t option to make ssh use an interactive shell:
This will prompt twice for the password. The first time to establish the remote connection and the second time for
sudo on the remote machine.
Sending single commands with
ssh can be useful for automating workflows in scripts. However, the requirement to keep entering passwords will be very detrimental to automation. It will also be annoying when you frequently connect to specific remote Macs.
Torrent Client For Mac
We will discuss how the key security works and how it can replace passwords in the following posts.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |