Add new comment
|
Have you tried using the config file? I beleive it would be more simple. create a config file for you user, usually ~/.ssh/config
In it you can put the following
host=host1 user=root
host=host2 user=admin port=23230
You can also use wildcards
host=*domain.com port=12345
Personnaly I have to connect to many servers as the user admin, so I have the following:
host * user=admin
another useful option is ControlMaster auto ControlPath /tmp/%h this creates a control file in /tmp. This lets you open new sessions on the same host without reauthenticating yoruself. I put this in the host * block.
Since scp/rsync etc use ssh, these settings apply to them also. In addition these specify "defaults". For example even though I specify admin as the user for all hosts, if I run ssh root@host it will overwrite the setting and conenct as root. Hope these help :)
Reply |



Recent comments
13 hours 39 min ago
18 hours 28 min ago
23 hours 17 min ago
1 day 1 hour ago
1 day 1 hour ago
1 day 2 hours ago
1 day 6 hours ago
1 day 6 hours ago
1 day 9 hours ago
1 day 16 hours ago