How to share keyboard/mouse in Linux without X11 environment
笔记本连个招呼都不打说死就死了,于是着手配置树莓派作为我的网络中心/手边唯一的linux终端。嵌入式就不要装X了。有X的话Synergy是跨平台共享鼠标键盘神器,显然没有图形服务器它根本不知道把输入往哪送。所以没有X的方案要解决两个问题:
We need to accomplish two things:
A. Login as root on startup automatically.
B. Send K/M actions
A
本来觉得很邪门了但是果然是有妥妥的办法的..
1) 添加行
NO_PASSWORD_CONSOLE tty1
到 /etc/login.defs
2) 在 /etc/inittab 找到
1:2345:respawn:/sbin/mingetty tty1
改成
1:2345:respawn:/sbin/mingetty –autologin root tty1
对我就直接登录了非常hěn呀的root
B
开始想写个脚本直接从SSH发送指令给tty1,琢磨了好久,发现一个叫console-tools的包里有指令writevt可以发送指令到/dev/tty1的input buffer里,但是不知道怎么按回车..
echo command > /dev/tty1 也是一样不知道怎么按回车.. 感觉好像不是这么用的。不过可以唤醒屏幕。
(后记: 确实不是这么用的 只是能发送显示字符串 另外发送 echo -ne “\033[9;0]” >/dev/tty1 就可以取消terminal的自动黑屏 参见 http://www.winds.org/pub/grdl/ANSI.txt , 为什么会有这种ANSI代码)
顷刻,突然想到直接在.bashrc里登录运行某个共享的screen就好了,~/.bashrc 写入
[bash]
if [ "$STY" = "" ]
#不想SSH也自动的话就
#if [ "$STY" = "" ] && [ `tty` = "/dev/pts/0" ]
then
if ! screen -list | grep -q "asdf"
then
screen -dmS asdf
fi
screen -x asdf
fi
[/bash]
-x是可以容许多用户登录同一个屏幕,所有内容完全同步。然后就行了,重启本尊,再分身SSH进去,本尊的屏幕很近的话就把分身SSH窗口拉到角落里看不见的地方,只要窗口激活输入就同步到本尊上,再设个快捷键,tsing.
A
1) Add
NO_PASSWORD_CONSOLE tty1
To /etc/login.defs
2) In /etc/inittab Search for
1:2345:respawn:/sbin/mingetty tty1
Change to
1:2345:respawn:/sbin/mingetty –autologin root tty1
You can choose a different user of course. I use the raspberry Pi at home so, security is for pussies.
B
Simply tell bash to mount a Screen upon login. Append to ~/.bashrc
[bash]
if [ "$STY" = "" ]
#Or this if you don’t want to be mounted as SSH client
#if [ "$STY" = "" ] && [ `tty` = "/dev/pts/0" ]
then
if ! screen -list | grep -q "asdf"
then
screen -dmS asdf
fi
screen -x asdf
fi
[/bash]
-x tolerates multiple mounts on a single screen. Optionally add a shortcut to your SSH client. There you go, it’s working really well for me.
References:
Lollybet Casino Review http://karanova.ru/?goto=https://weadown.in/brucekeene7445
References:
Lollybet Casino Seriös naruminato.xtgem.com
References:
Lollybet Casino Gutschein http://image.google.fm
References:
Lollybet Slots http://www.google.com.na/url?sa=t&url=https://biolink.belfiusolucoes.com.br/grazynamancini
References:
Royal vegas casino https://glofcee.com/employer/support/
References:
Playboy casino https://jobcop.ca/employer/instant-casino-de-live-casino-und-bonus-aktionen-online/
References:
Casino rotten tomatoes https://jobworkglobal.com/employer/bonus-3000-300-fs/
References:
4 winds casino https://theskysupply.com/forum/index.php?topic=2258.0
References:
Coyote valley casino https://asanghaa.com
References:
Casino equipment https://jobteck.com.sg
References:
Cinema casino bagnols sur ceze jobs-max.com
References:
Metropolis casino jobzalert.pk
References:
Lollybet Bewertung http://clients1.google.com.lb/url?q=https://www.jobindustrie.ma/companies/deine-online-spielothek/
References:
Lollybet Casino Slots http://www.saltedge.com
References:
Lollybet Casino Gutschein http://images.google.com.ng/
References:
Lollybet Startguthaben http://image.google.cv/url?rct=j&sa=t&url=https://werkstraat.com/companies/spielothek-mit-live-casino-jackpots/
References:
Lollybet Casino Willkommensbonus asia.google.com
References:
Lollybet Casino Sicherheit oluchi.yn.lt
References:
Lollybet Casino Erfahrungen gamer.kg
References:
Lollybet Casino Bonus Code https://comita.spb.ru/