使用使用者名稱user1連線test.server1
ssh -l user1 test.server1 或者:ssh [email protected]
ssh -l user1 -p 22 test.server1 # -p: 指定埠,預設的是22
使用scp和遠端機器互相拷貝檔案
scp [email protected]:/etc/lilo.conf /etc # 從遠端的test.server1拷貝檔案/etc/lilo.conf到本地目錄/etc/下
scp /etc/lilo.conf [email protected]:/home/user1 # 將本地檔案/etc/lilo.conf拷貝到遠端主機test.server1的/home/user1下
不用輸入密碼,直接ssh登入遠端主機
step 1 - 生成公鑰和私鑰
ssh-keygen -t rsa
公鑰:identity.pub 私鑰:identity
step2 - 將公鑰identity.pub拷貝到遠端主機的$home/.ssh/authorized_keys (this is a file)
scp ./identity.pub [email protected]:.ssh/authorized_keys
禁止root用ssh登入
# vi /etc/ssh/sshd_config
permitrootlogin no
廢除密碼登入,強迫使用rsa驗證
# vi /etc/ssh/sshd_config
rsaauthentication yes
pubkeyauthentication yes
authorizedkeysfile .ssh/authorized_keys
passwordauthentication no
# service sshd restart
# su - user1
$ mkdir ~/.ssh 2>/dev/null
$ chmod 700 ~/.ssh
$ touch ~/.ssh/authorized_keys
$ chmod 644 ~/.ssh/authorized_keys
ssh配置詳解
2009 06 11 12 57 一.首先配置web.xml spring character encoding filter org.springframework.web.filter.characterencodingfilter encoding utf 8 hibernatefilter ...
SSH命令詳解
ssh 的詳細使用方法如下 ssh l login name hostname user hostname command ssh afgknqtvxcpx246 c blowfish 3des e escape char i identity file l login name o option ...
ssh命令詳解
ssh 的詳細使用方法如下 ssh l login name hostname user hostname command ssh afgknqtvxcpx246 c blowfish 3des e escape char i identity file l login name o option ...