Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- echo password | ssh id@server
- $ ssh-keygen -t rsa -b 2048
- Generating public/private rsa key pair.
- Enter file in which to save the key (/home/username/.ssh/id_rsa):
- Enter passphrase (empty for no passphrase):
- Enter same passphrase again:
- Your identification has been saved in /home/username/.ssh/id_rsa.
- Your public key has been saved in /home/username/.ssh/id_rsa.pub.
- $ ssh-copy-id id@server
- id@server's password:
- .ssh/authorized_keys
- $ ssh id@server
- id@server:~$
- $ sudo apt-get install sshpass
- $ sshpass -p your_password ssh user@hostname
- # ssh-keygen
- # ssh-copy-id hostname
- # ssh hostname
- #!/usr/bin/expect -f
- # ./ssh.exp password 192.168.1.11 id
- set pass [lrange $argv 0 0]
- set server [lrange $argv 1 1]
- set name [lrange $argv 2 2]
- spawn ssh $name@$server
- match_max 100000
- expect "*?assword:*"
- send -- "$passr"
- send -- "r"
- interact
- # ./1.ex password localhost ooshro
- spawn ssh ooshro@localhost
- ooshro@localhost's password:
- Linux ubuntu-1010-server-01 2.6.35-25-generic-pae #44-Ubuntu SMP Fri Jan 21 19:01:46 UTC 2011 i686 GNU/Linux
- Ubuntu 10.10
- Welcome to Ubuntu!
- * Documentation: https://help.ubuntu.com/
- Last login: Tue Mar 1 12:41:12 2011 from localhost
- #!/usr/bin/perl
- use warnings;
- use strict;
- use Net::SSH::Perl;
- my $host = 'remote.serv.er';
- my $user = 'root';
- my $pass = 'hunter2';
- my $ssh = Net::SSH::Perl->new('$host');
- $ssh->login('$user', '$pass') or die "Oh noes! $!";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement