https://github.com/AgentDS/CSCI-596-18fall
assignment for CSCI 596: Scientific Computing & Visualization
https://github.com/AgentDS/CSCI-596-18fall
Last synced: 9 months ago
JSON representation
assignment for CSCI 596: Scientific Computing & Visualization
- Host: GitHub
- URL: https://github.com/AgentDS/CSCI-596-18fall
- Owner: AgentDS
- Created: 2018-08-27T22:51:40.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-29T00:22:14.000Z (over 7 years ago)
- Last Synced: 2025-04-12T17:15:47.993Z (about 1 year ago)
- Language: POV-Ray SDL
- Size: 13.2 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-mess - 使用`expect`完成脚本一键登录服务器
README
# CSCI-596-18fall
assignment for CSCI 596: Scientific Computing & Visualization
### Tips on Using SFTP & SSH
For convenience, write __*.expect__ scripts to log into SFTP and SSH automatically.
You need to install __expect__ first. For example in Mac OS X, using
```bash
brew install expect
```
File __login-sftp.expect__:
```bash
#!/usr/bin/expect
set timeout 30
spawn sftp username@host-name
expect "*password: "
send "your-password\r"
expect "sftp> "
interact
```
File __login-ssh.expect__:
```bash
#!/usr/bin/expect
set timeout 30
spawn ssh username@host-name
expect "*password:"
send "your-password\r"
interact
```
To use these, just use command below in the Terminal (assuming _$PATH_LOGIN_ is the directory where the expect scrips are):
```bash
expect $PATH_LOGIN/login-ssh.expect
```
or
```bash
expect $PATH_LOGIN/login-sftp.expect
```
Further more, we can use alias to make it more faster, add lines below in __./zshrc__ (since I use __zsh__):
```bash
alias login_ssh="expect $PATH_LOGIN/login-ssh.expect"
alias login_ssh="expect $PATH_LOGIN/login-ssh.expect"
```
Then type key __esc__ and __:wq__ to save it.
Then enter command below in Terminal:
```bash
source ./zshrc
```
Now you can use command ``login_ssh``/``login_sftp`` directly to connect to the remote host!
SSH login output:

SFTP login output: