1.下载安装ssh
kens@ubuntu:~$ sudo apt-get install ssh
2.配置ssh
kens@ubuntu:~$ sudo vim /etc/ssh/sshd_config
# Authentication:
LoginGraceTime 120
#PermitRootLogin without-password
PermitRootLogin yes
StrictModes yes
修改PermitRootLogin without-password(红色部分)为PermitRootLogin yes,并将原来
保存退出
3.重启服务,一般包含两中方法service ssh restart和 /etc/init.d/ssh restart
kens@ubuntu:~$ service ssh restart
stop: Unknown job: ssh
start: Unknown job: ssh
kens@ubuntu:~$ service ssh restart
stop: Unknown job: ssh
start: Unknown job: ssh
kens@ubuntu:~$
kens@ubuntu:~$ /etc/init.d/ssh restart
亲测,发现第一个不能用。
4.查看如何使用ssh
kens@ubuntu:~$ ssh -h
unknown option -- h
usage: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
[-D [bind_address:]port] [-E log_file] [-e escape_char]
[-F configfile] [-I pkcs11] [-i identity_file]
[-L [bind_address:]port:host:hostport] [-l login_name] [-m mac_spec]
[-O ctl_cmd] [-o option] [-p port]
[-Q cipher | cipher-auth | mac | kex | key]
[-R [bind_address:]port:host:hostport] [-S ctl_path] [-W host:port]
[-w local_tun[:remote_tun]] [user@]hostname [command]
kens@ubuntu:~$