=================================================================
OPENSSH-LAB> ssh 를 이용한 명령어 사용
o 사용법:
ssh sshuser@hostname cmd
ssh -l sshuser hostname cmd
- ID/PW 인증이 정상적으로 성공하면 명령어(cmd) 가 성공적으로 실행된다. (단 로그인은 안된다.)
Client# ssh sshuser@localhost pwd
sshuser@localhost's password: <-- ID/PW 기반 인증
/home/sshuser
Client# ssh sshuser@localhost id
sshuser@localhost's password: <-- ID/PW 기반 인증
uid=525(sshuser) gid=525(sshuser) groups=525(sshuser) ...
Client# ssh sshuser@localhost top -b -n 1
sshuser@localhost's password:
top - 16:26:18 up 6:45, 2 users, load average: 0.52, 0.48, 0.45
Tasks: 51 total, 1 running, 50 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.4%us, 1.5%sy, 0.0%ni, 97.3%id, 0.2%wa, 0.1%hi, 0.5%si, 0.0%st
Mem: 514868k total, 298552k used, 216316k free, 57368k buffers
Swap: 1048568k total, 0k used, 1048568k free, 201872k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 root 15 0 2176 648 556 S 0.0 0.1 0:00.43 init
2 root RT -5 0 0 0 S 0.0 0.0 0:00.00 migration/0
3 root 34 19 0 0 0 S 0.0 0.0 0:00.92 ksoftirqd/0
:
:
=================================================================