使用mc-tool实现empathy的自动登录与处理密钥环问题
来源:互联网 发布:webshell查杀工具 编辑:程序博客网 时间:2024/05/22 01:39
项目中使用empathy来实现一个远程协助的功能,需要自动帮客户端登录empathy,为了处理这个问题,找到了mc-tool来设置帐号。
例如添加帐号:
mc-tool add gabble/jabber 10.1.82.165@10.1.122.173 string:account=10.1.82.165@10.1.122.173 string:password=qwer1234 bool:require-encryption=true bool:ignore-ssl-errors=true
查看帐号:
mc-tool list
使用mc-tool remove可以删除。
因此做了个脚本,实现系统启动时候,自动添加好empathy的帐号。但首次执行会报 选择新密钥环的密码
若点击ESC取消,则设置仍会出这个。若点击取消按钮或确定,倒是可以。
一开始以为.local/share/keyring/下设置Default密钥环,后来试了发现是还是不行。
最后才找到应该在路径.config/mate/keyring/下设置,即OK了
附带脚本如下:
#!/bin/sh# Jabber服务器地址(ip地址或域名)server=10.1.122.173# 账户ID(为方便处理,id名称请使用字母和数字,不要包含任何其它字符和符号)id=10.1.82.165jid=${id}@${server}# 账户密码jid_pw=10.1.82.165cat >/usr/local/bin/do_jid_action.sh <<FOE#!/bin/shkeyring_init() { # 预置一个不加密的缺省keyring,从而避免用户交互 [ ! -d ~/.config/mate/keyrings ] && mkdir -p ~/.config/mate/keyrings && chmod 700 ~/.config/mate/keyrings cat > ~/.config/mate/keyrings/Default_keyring.keyring << EOF[keyring]display-name=Default keyringctime=\$(date +%s)mtime=0lock-on-idle=falselock-after=falseEOF echo "Default_keyring" > ~/.config/mate/keyrings/default chmod 600 ~/.config/mate/keyrings/Default_keyring.keyring chmod 600 ~/.config/mate/keyrings/default}jid_add() { # 检查要创建的账户是否已经存在,如存在则删除 account_id=$(echo ${jid}|sed 's/\./_2e/g'|sed 's/\@/_40/g') for i in \$(mc-tool list |grep \${account_id}); do mc-tool remove \$i done # 创建账户 account=\$(mc-tool add gabble/jabber ${jid} string:account=${jid} string:password=${jid_pw} bool:require-encryption=true bool:ignore-ssl-errors=true) echo account=${account} # set Icon=im-jabber mc-tool icon \${account} im-jabber # set Enabled=true mc-tool enable \${account}}if [ ! -f ~/.jid_init_done ];then [ -s ~/.config/mate/keyrings/default ] || keyring_init jid_add [ "$?" -eq 0 ] && touch ~/.jid_init_donefiFOEchmod a+x /usr/local/bin/do_jid_action.sh# 增加自启动服务,用户登录时建立账户#grep "/usr/local/bin/do_jid_action.sh" /etc/bashrc#[ "$?" -ne 0 ] && echo "/usr/local/bin/do_jid_action.sh" >> /etc/bashrcif [ ! -f /etc/xdg/autostart/xdg-jid-init.desktop ];then cat > /etc/xdg/autostart/xdg-jid-init.desktop << EOF[Desktop Entry]Type=ApplicationName=JID INITExec=/usr/local/bin/do_jid_action.shOnlyShowIn=GNOME;MATE;EOFfi
参考:
empathy
https://wiki.gnome.org/action/show/Apps/Empathy?action=show&redirect=Empathy
mc-tool
http://telepathy.freedesktop.org/wiki/Mission_Control/
Telepathy Developer’s Manual
http://telepathy.freedesktop.org/doc/book/index.html
Components
http://telepathy.freedesktop.org/wiki/Components/
0 0
- 使用mc-tool实现empathy的自动登录与处理密钥环问题
- Ubuntu下的Empathy登录QQ的问题
- 解决Empathy IM无法登录QQ的问题
- Putty使用密钥进行自动登录的一些经验
- putty 使用密钥自动登录 ssh
- putty 使用密钥自动登录 ssh
- linux ssh的安装与配置以及实现密钥登录
- 使用putty实现密钥登录远端服务器
- 无密钥登录的自动脚本实现(ssh-copy-id、expect免交互输入脚本)
- ubuntu Empathy登录QQ
- ubuntu empathy登录Qq
- sshd_config配置问题导致无法用密钥对自动登录
- ubuntu下应用ssh登录开发板的密钥问题处理
- Pidgin和Empathy登录Google企业套件帐号的GTalk
- servicegroup的mc实现
- Linux ssh密钥自动登录
- 自动登录的实现
- 自动登录的实现
- Android学习 - 拨号盘dialer定制声音DTMF Tones
- QML中的模型/视图--在QML中呈现数据
- OpenGL旋转
- 自定义回调 并将之以参数的形式传入
- 数据库 主从一致性检查和修复
- 使用mc-tool实现empathy的自动登录与处理密钥环问题
- [Erlang]比特语法详解,看看你知道多少
- eclipse经常未响应优化
- Python第四节FUNCTIONS学习汇总。
- STL系列之二 stack栈
- nginx动态数组ngx_array_t
- Solr之DIH配置(数据导入)
- Shell中脚本变量的作用域
- hdparm用法