Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I found that I can do scp in mc via cd /#sh:radek@firebird from the command line.

Is there any way I can

  • save this as a favorite?
  • Maybe even with the password?
share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

To simplify your setup, you can set up an SSH config file which is located at ~/.ssh/config. Add an entry to the file like:

Host server
User l33t
HostName server.example.org

The HostName directive is optional if it matches the name given in Host. This is basically an alias to typing l33t@server.example.org. You could make the name as short a s in the Host line if you want to avoid a lot of typing. You can also ignore the User line when the remote username is the same as your local username. With the above config, all you need to type is ssh server, scp file-to-copy server:, and so on.

OpenSSH does not support storing passwords since this is normally a bad idea, but it offers a more secure alternative called public key authentication. With public keys, you can log onto multiple servers automatically even if each server has a different password. Public keys use a private key that is normally stored on disk with a password. This password is use to load the private key which is then used to authenticate to the remote server. To avoid typing in the password for the private key all the time, the private key can be loaded into an SSH Public Key Agent such as ssh-agent or GNOME Keyring. While the agent is running with the loaded private key, you can authenticate to any server automatically with no password needed. You can also store a private key to disk without a password, but this is less secure and equivalent to storing a plain-text password to disk. Take a look at setting up ssh public key.

share|improve this answer
    
so by doing that I can then type cd host in mc? –  Radek May 5 '11 at 4:25
1  
@Radek I don't normally use mc myself, but that doesn't seem right. The cd command is normally just for changing folders locally. I just pulled up mc and clicked on Shell Link under the Right menu. I then typed in server which is the alias for my server entry and it automatically connected using my public key with no problems. –  penguin359 May 5 '11 at 4:31
2  
in that case you nicely answered my question :-) Thank you –  Radek May 5 '11 at 4:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.