Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ssh(sftp) with certificate via Nautilus in Ubuntu 10.10

Before I connected to my server via Nautilus (sftp). Now I moved to Amazon EC2, and there's just one way connect to server (ubuntu 10.10 too), using ssh -i mycert.pem, no password, just certificate. How can I connect to the server using Nautilus, just like i did before? In other way I guess I can disable certificate by making some changes in /etc/ssh/ssh_config,but not sure what to do.

UPD: Finally i found solution by using sshfs, more explanation here How to mount Amazon ec2 drive locally - fuse + sshfs?

and googling by keywords sshfs + amazon ec2

UPD2:

ssh-add /path/to/my_cert.pem

and after this connection to sftp via nautilus also working fine

like image 509
Valentin Kantor Avatar asked Apr 12 '11 21:04

Valentin Kantor


People also ask

How do I connect to a SFTP server on Ubuntu?

To connect to an SFTP server with the command-line on Ubuntu, start by launching a terminal window. Then, with the terminal window open, use the sftp command to connect to your SSH server.

How do I connect to SFTP using Nautilus?

In the Nautilus file browser and click + other locations at the bottom of the file browser. The connect to server dialog will open and enter the following connection string into the dialog and click the connect button: sftp://<username>@sftp.csc.uvic.ca/public_html You will be promtpted for your account password.

How do I SSH into SFTP from command line?

Command-line SFTP with SSH-Keys If you have configured an SSH-KEY, you can specify to use your private key to connect by using the ssh/sftp identity -i parameter in the command line: $ sftp -i /.ssh/my_key_file user@remote-host SFTP using Linux GUI File Browser (Nautilus)

How do I connect to an SSH server in Linux?

Then, with the terminal window open, use the sftp command to connect to your SSH server. To connect, specify the username on the remote machine, as well as its IP address. For example, if the remote Ubuntu server or Ubuntu PC hosting an SSH server has an IP address of “192.168.1.203,” use that as the hostname.


1 Answers

I don't quite know what you mean by "I guess I can disable certificate" when you just said "and there's just one way connect [...] just certificate"?

I guess you'd like to have something more like this in .ssh/config. Append a section like the following 5 lines to any existing ~/.ssh/config (i.e. /home/sehe/.ssh/config)

Host myec2host
HostName 151.47.12.88
User ubuntu
IdentityFile ~/.ssh/mycert.pem
Compression yes

Note

  1. Replace myec2host by the alias that you want to access the ec2 instance by
  2. Replace the IP address by the external (optionally elastic) IP address of your instance
  3. Replace ~/.ssh/mycert.pem by the full path to your private key (usually the keypair) you registered the instance with; I copied the name mycert.pem from your own question, so it is probably that file
  4. Any other options (like Compression) are optional. By default, Ubuntu images on ec2 (especially the ones from Canonical) should be logged onto using user ubuntu; root won't work

Of course man ssh_config will do miracles for the details. Also, http://alestic.com/ is an excellent resource on Ubuntu+EC2 (just make sure you don't confuse the Alestic and Canonical images). Lastly there is the google group for ec2ubuntu which has been very helpful to starters.


This way you can just point Nautilus at the server 'my3c2host' and get the reset for free. If the key is protected with a passphrase, you can use a passphrase agent (seahorse, gpg-agent... dunno by heart)

like image 188
sehe Avatar answered Nov 03 '22 23:11

sehe