LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2325|回复: 1

linux 自动登录 自动运行

[复制链接]
发表于 2009-3-17 11:11:27 | 显示全部楼层 |阅读模式
众多方法的一种把,普通linux,不知道嵌入式用不用得到,因该发在新手区的,不知道还有没有更好地实现办法,word文档有格式
A. Autologin 自动登录
1 Using a C login program C语言实现
a.        Code 代码
#include <unistd.h>

int main() {
   execlp( "login", "login", "-f", "username", 0);
}

b.        Compile it 编译
# gcc -o autologinusername autologinusername.c

c.        Gain root access (with su) and copy the executable to a public directory: 复制(需root)
# cp autologinusername /usr/local/sbin/

d.        Modify /etc/inittab 修改/etc/inittab
c1:2345:respawn:/sbin/agetty 38400 vc/1 linux
to 为
c1:2345:respawn:/sbin/agetty –n -l /usr/local/sbin/autologinusername 38400 vc/1 linux2 Use the mingetty package 软件包方式实现
Modify /etc/inittab 修改..
c1:2345:respawn:/sbin/mingetty --autologin username vc/1 linux
Change every line to use mingetty if you prefer, however that's not necessary.
B.Autorun 自动运行
Modify /etc/profile add a line like: 修改...
/path/allinproject –h time.windows.com –d 5

;;  /etc/inittab 在各个机器上有所不同,请自行...

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
发表于 2009-5-5 10:56:59 | 显示全部楼层
解决了一些疑问,学习了
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表