Giter Site home page Giter Site logo

Comments (7)

jiangxianli avatar jiangxianli commented on August 30, 2024

@muzixinly 好的,谢谢你的补充!

from sshautologin.

baichuan3 avatar baichuan3 commented on August 30, 2024

是我写的问题,&不用补充[笑哭]

from sshautologin.

MrYangH avatar MrYangH commented on August 30, 2024

你是Mac用户吧?如果是的话,你可以去下载Shuttle配合expect脚本来使用,这样更方便。

#!/usr/bin/expect
set host_user [lindex $argv 0]
set host_addr [lindex $argv 1]
set host_port [lindex $argv 2]
set host_password [lindex $argv 3]
spawn ssh $host_user@$host_addr -p $host_port
expect {
	"*(yes/no)?"
	{
		send "yes\r" ; exp_continue
	}
		"*assword:"
	{
		send "$host_password\r" ; exp_continue
	}
}
interact

Shuttle中的一个例子,如下配置,把用户名、IP、端口、密码当参数传入

{
            "cmd": "expect /Users/xxx/Documents/xxx/ssh.exp username ip port pwd",
            "inTerminal": "tab",
            "name": “test",
            "theme": "basic",
            "title": “test"
        }

这样的好处是,可以随时从Shuttle的菜单中一键开启终端并ssh完成。完全不用手动执行脚本。

from sshautologin.

jiangxianli avatar jiangxianli commented on August 30, 2024

@MrYangH 我是用的Mac使用的iterm,配置快捷键用的

from sshautologin.

thinkd1ff avatar thinkd1ff commented on August 30, 2024

mac 用户 进行$转义\\\$后,也无法登录。。提示密码错误,没有$的其他转义成功登录!

from sshautologin.

MrYangH avatar MrYangH commented on August 30, 2024

@rainplus 用一个反斜杠就行了,不要三个反斜杠转义,除了$,还有几个符号也是需要转义的比如@() 还有其他的你自己遇到了试试吧

from sshautologin.

thinkd1ff avatar thinkd1ff commented on August 30, 2024

@MrYangH 尝试过,在mac下,其他的转义成功,()并不需要转义,$的各种方式都尝试过了。坑。还是不行。。

from sshautologin.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.