问题
linux操作, ssh, vi
自动获取IP的网卡设置怎嘛查看IPv4?
将/etc/sysconfig/network-scripts/ifcfg-eth0中的BOOTPROTO的值更改成dhcp. 然后ifdown 网卡名, ifup 网卡名.linux某一项service没有找到?
将可执行文件的路径加入PATH中。相关文件(ubuntu): /etc/environment能Ping通linux,但是不能ssh远程登录。
查看ssh服务是否开启,ps -e |grep ssh
没有ssh存在就说明没有ssh服务。
$ ps -e |grep ssh
4682 ? 00:00:00 sshd
则是存在的.
解决ssh服务问题: 在/etc/init.d中没有ssh则没有安装ssh。如果存在直接重启。否则安装,建议命令行+网络方式。
如果存在,那么查看22端口是否开放
ssh localhost
出现连接拒绝的信息就说明端口有问题。
解决端口问题: 编辑/etc/ssh/ssh_config
将port 22和protocol 2,1注释掉。重启即可。
Ubuntu的root密码是多少?
Ubuntu的默认root密码是随机的,即每次开机都有一个新的root密码。可以使用sudo passwd root来解决这个问题。假设安装软件后有图标,但是不知道可执行文件的路径怎么办?
可以将软件运行起来,然后ps -e |grep processname
得到进程号,接着输入ll /proc/pid
。查看,存在类似exe -> /usr/bin/
的信息,它即是绝对路径。ssh远程登录运行Qt,出现错误:QXcbConnection: Could not connect to display
首先,确定远端允许X11转发,将/etc/ssh/sshd_config中X11Forwarding 置成yes
然后,在本地安装xshell + xmanager。
设置xshell: 文件——属性——SSH——隧道——转发x11到——xmanager——确定
xshell远程登录后即可正常使用软件。在vi(vim)中怎样删除某一列,或者某几列,某几行?
使用visual模式,找到一个角点,按下ctrl+v,进入visual block模式,选中对角线的另一个角点,选中的部分按下x(或者 d)就能删除。root也杀不死进程?
[root@localhost test]# ps aux |grep udp1
weiyang 16351 0.0 0.0 4164 348 pts/4 T 15:45 0:00 ./udp1
root 18017 0.0 0.0 112640 960 pts/4 S+ 16:03 0:00 grep --color=auto udp1
[root@localhost test]# kill 16351
[root@localhost test]# ps aux |grep udp1
weiyang 16351 0.0 0.0 4164 348 pts/4 T 15:45 0:00 ./udp1
root 18020 0.0 0.0 112640 960 pts/4 S+ 16:03 0:00 grep --color=auto udp1
可以查看进程树,找一找进程间的关系:
pstree > read
vi read
/udp1
然后找到父进程杀死:
[root@localhost test]# ps aux |grep ssh
root 1840 0.0 0.1 137904 5324 ? Ss 11:41 0:00 sshd: weiyang [priv]
weiyang 1842 0.0 0.0 137904 2344 ? S 11:41 0:00 sshd: weiyang@pts/3
root 2014 0.0 0.1 137904 5320 ? Ss 11:44 0:00 sshd: weiyang [priv]
weiyang 2016 0.0 0.0 137904 2344 ? S 11:44 0:01 sshd: weiyang@pts/4
huzheng+ 2790 0.0 0.0