{"id":515,"date":"2015-04-15T06:12:58","date_gmt":"2015-04-14T22:12:58","guid":{"rendered":"http:\/\/www.datarelab.com\/blog\/?p=515"},"modified":"2016-01-07T20:49:20","modified_gmt":"2016-01-07T12:49:20","slug":"ubuntu-%e6%9c%8d%e5%8a%a1%e5%99%a8%e9%85%8d%e7%bd%ae","status":"publish","type":"post","link":"https:\/\/www.datarelab.com\/blog\/Technical_literature\/515.html","title":{"rendered":"Ubuntu \u670d\u52a1\u5668\u914d\u7f6e"},"content":{"rendered":"<p><strong>\u4e00\u3001\u8bbe\u7f6eroot\u5bc6\u7801<\/strong><\/p>\n<p>1.\u5728\u7ec8\u7aef\u952e\u5165sudo passwd\uff1b<br \/>\n2.\u4f1a\u63d0\u793a\u4f60\u8981\u8f93\u5165\u5f53\u524d\u7528\u6237\u5bc6\u7801\uff0c\u6309\u7167\u63d0\u793a\u8f93\u5165\uff0c\u56de\u8f66\uff1b<br \/>\n3.\u8bbe\u7f6eroot\u5bc6\u7801\uff0c\u8fd9\u65f6\u5c31\u4f1a\u63d0\u793a\u4f60\u952e\u5165root\u7684\u5bc6\u7801\uff0c\u6309\u7167\u63d0\u793a\u8f93\u5165\uff1b<br \/>\n4.\u786e\u8ba4\u5bc6\u7801\uff0c\u4f1a\u63d0\u793a\u4f60\u518d\u6b21\u8f93\u5165\u5bc6\u7801\u786e\u8ba4\uff1b<br \/>\n5.\u767b\u5f55root\u7528\u6237\uff1asu root\uff0c\u56de\u8f66\u8f93\u5165\u5bc6\u7801\uff1b<br \/>\n6.\u6210\u529f<\/p>\n<p><strong>\u4e8c\u3001\u5f00\u542f root ssh \u767b\u5f55<\/strong><\/p>\n<p>1.\u5f00\u542froot\u8fdc\u7a0b\u767b\u5f55\u6743\u9650<br \/>\nsudo vi \/etc\/ssh\/sshd_config<br \/>\n\u5c06PermitRootLogin without-password \u4fee\u6539\u4e3aPermitRootLogin yes<br \/>\n2.\u91cd\u542fssh\u670d\u52a1<br \/>\nservice ssh restart<\/p>\n<p><strong>\u4e09\u3001\u5347\u7ea7\u4e0e\u6e05\u7406\u5783\u573e\u547d\u4ee4 \u00a0-- \u00a0<span style=\"color: #ff0000;\">\u6700\u597d\u66f4\u6362\u6e90\uff0c\u7528\u56fd\u5185\u7684\uff1b<\/span><\/strong><\/p>\n<p>sudo apt-get update<br \/>\nsudo apt-get dist-upgrade\uff08\u8017\u65f6\u8f83\u957f\uff09<\/p>\n<p>sudo apt-get autoclean \u6e05\u7406\u65e7\u7248\u672c\u7684\u8f6f\u4ef6\u7f13\u5b58<br \/>\nsudo apt-get clean \u6e05\u7406\u6240\u6709\u8f6f\u4ef6\u7f13\u5b58<br \/>\nsudo apt-get autoremove \u5220\u9664\u7cfb\u7edf\u4e0d\u518d\u4f7f\u7528\u7684\u5b64\u7acb\u8f6f\u4ef6<\/p>\n<p><strong>\u56db\u3001\u4fee\u6539\u914d\u7f6e samba<\/strong><\/p>\n<p>cp \/etc\/samba\/smb.conf \/etc\/samba\/smb.conf.bak<br \/>\nvim \/etc\/samba\/smb.conf<\/p>\n<p>[share]<br \/>\npath = \/home\/martin\/samba_share<br \/>\navailable = yes<br \/>\nbrowseable = yes<br \/>\npublic = yes<br \/>\nwritable = yes<\/p>\n<p>[home]<br \/>\npath = \/home<br \/>\nvalid users = root<br \/>\npublic = no<br \/>\nwritable = yes<br \/>\nprintable = no<br \/>\ncreate mask = 7777<\/p>\n<p>\u8bbe\u7f6e\u76ee\u5f55\u6743\u9650<br \/>\nmkdir \/home\/martin\/samba_share<br \/>\nsudo chmod 777 samba_share\/<\/p>\n<p><strong>\u4e94\u3001vsftpd\u672c\u5730\u7528\u6237root\u65e0\u6cd5\u767b\u5f55\u7684\u95ee\u9898<\/strong><\/p>\n<p>\u5728etc\u76ee\u5f55\u4e0b\u6709\u4e2aftpuser\u6587\u4ef6\uff0c\u662f\u7528\u6765\u8bb0\u5f55\u4e0d\u5141\u8bb8\u8fde\u63a5\u7684\u7528\u6237\u5217\u8868\uff0c\u5176\u4e2droot\u4e5f\u5305\u542b\u5728\u91cc\u9762\u3002\u6ce8\u91caroot\u8fd9\u4e00\u884c\uff0c\u518d\u91cd\u65b0\u8fde\u63a5\uff0c\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<p><strong>\u516d\u3001\u589e\u52a0\u7528\u6237<\/strong><\/p>\n<p>adduser self<\/p>\n<p><strong>\u4e03\u3001\u8bbe\u7f6e\u56fa\u5b9aip\u5730\u5740<\/strong><\/p>\n<p>http:\/\/jingyan.baidu.com\/article\/e5c39bf5bbe0e739d7603396.html<\/p>\n<p><strong>\u516b\u3001pptpsetup\u547d\u4ee4\u884c\u8fde\u63a5pptp vpn | \u62e8\u53f7<\/strong><\/p>\n<p>apt-get install pptp-linux<br \/>\n\u6dfb\u52a0\u4e00\u4e2avpn\u8fde\u63a5\uff0c\u6267\u884c<\/p>\n<p>pptpsetup -create vpnname -server xxx.xxx.xxx.xxx -username username -password passwd -encrypt (\u8bb0\u5f97\u6539\u4e00\u4e0b)<br \/>\nPS:\u66f4\u591a\u9009\u9879\u8fd0\u884c\u201dpptpsetup \u2013help\u201d<\/p>\n<p>\u8fd9\u6837\u5176\u5b9e\u662f\u5199\u5165\u4e86\/etc\/ppp\/peers\/ \u8fd9\u4e2a\u76ee\u5f55\u4e0b\u9762\uff08\u7f51\u4e0a\u6709\u5728\u8fd9\u4e2a\u76ee\u5f55\u65b0\u5efa\u6587\u4ef6\u7684\u65b9\u6cd5\uff0c\u770b\u6765\u4e0d\u5982\u8fd9\u4e2a\u65b9\u4fbf\uff09<\/p>\n<p>\/etc\/ppp\/chap-secrets \u7528\u6237\u540d\u5bc6\u7801\u5199\u5165\u5230\u4e86\u8fd9\u4e2a\u6587\u4ef6<\/p>\n<p>\u4e0a\u7ebf\uff1a<\/p>\n<p>pon vpnname<br \/>\n\u4e0b\u7ebf\uff1a<\/p>\n<p>poff vpnname (\u5168\u90e8\u4e0b\u7ebfpoff -a)<br \/>\n\u7136\u540eifconfig\u67e5\u770b\u4e00\u4e0b\u591a\u4e86ppp0\u8fd9\u4e2a\u7f51\u7edc<\/p>\n<p>\u73b0\u5728\u8fd8\u4e0d\u80fd\u901a\u8fc7vpn\u6765\u8d70<\/p>\n<p>\u56e0\u4e3a\u5e76\u4e0d\u77e5\u9053\u6570\u636e\u8be5\u600e\u4e48\u8d70\uff0c\u5f88\u660e\u663e\u8981\u914d\u4e00\u4e0b\u8def\u7531<\/p>\n<p>#route \u67e5\u770b\u73b0\u5728\u7684\u9ed8\u8ba4\u8def\u7531\uff0c\u4e0b\u9762\u4e24\u6761\u64cd\u4f5c\u5c06\u9ed8\u8ba4\u8def\u7531\u6539\u4e3avpn\u7684\u5730\u5740\uff0c\u5220\u9664\u539f\u6765\u7684\u9ed8\u8ba4\u8def\u7531<\/p>\n<p>route add default gw 10.19.1.1<br \/>\nroute delete default gw xxx.xxx.xxx.yyy<br \/>\n\u6216\u8005\u8fd9\u6837\u66f4\u7b80\u4fbf<\/p>\n<p>route del default<br \/>\n<span style=\"color: #0000ff;\"><strong>route add default dev ppp0 \uff08Linux\u8bbe\u7f6e\u9ed8\u8ba4\u8def\u7531\uff0c\u5982\u679c\u4e0d\u7528vpn\u5f53\u9ed8\u8ba4\u51fa\u53e3\u53ef\u4ee5\u4e0d\u7528\u8bbe\u7f6e\uff09<\/strong><\/span><br \/>\n<span style=\"color: #ff0000;\"><strong>route add -net 192.168.2.0 netmask 255.255.255.0 dev ppp0<\/strong><\/span><\/p>\n<p>\u8fd9\u6837\u5c31\u80fd\u901a\u8fc7vpn\u6765\u505a\u4e8b\u4e86\u3002<\/p>\n<p><strong>\u4e5d\u3001\u5f00\u673a\u81ea\u52a8\u8fd0\u884c<\/strong><\/p>\n<p>vim \/etc\/rc.local<\/p>\n<p><strong>\u5341\u3001DLNA\u670d\u52a1\u5668<\/strong><\/p>\n<p>a\u3001\u4f7f\u7528apt-get\u5b89\u88c5<br \/>\nsudo apt-get install minidlna<br \/>\nb\u3001\u4fee\u6539minidlna\u914d\u7f6e<br \/>\nsudo gedit \/etc\/minidlna.conf<br \/>\n\u53c2\u6570\u540d \u8bf4\u660e<br \/>\nport \u670d\u52a1\u7aef\u53e3\uff0c\u9ed8\u8ba4\u4e3a8200\u3002\u5982\u679c\u6709\u9632\u706b\u5899\u914d\u7f6e\uff0c\u9700\u8981\u5f00\u653e\u3002<br \/>\nmedia_dir \u5a92\u4f53\u76ee\u5f55\u53ef\u4ee5\u8bbe\u7f6e\u591a\u4e2a\uff0c\u5982\uff1amedia_dir=V,\/noah\/videos\uff08\u9017\u53f7\u524d\u4e3a\u7c7b\u578b\u6807\u8bc6\uff1aA\u97f3\u9891\uff0cP\u56fe\u7247\uff0cV\u89c6\u9891\uff09<br \/>\nfriendly_name \u670d\u52a1\u540d\u79f0\uff0c\u5728\u5176\u5b83\u8bbe\u5907\u4e2d\u770b\u5230\u7684\u540d\u79f0<br \/>\ninotify \u8bbe\u7f6e\u4e3atrue\uff0c\u5c06\u81ea\u52a8\u53d1\u73b0\u5a92\u4f53\u76ee\u5f55\u4e2d\u7684\u65b0\u6587\u4ef6<\/p>\n<p>\u4e00\u822c\u4e5f\u5c31\u8bbe\u7f6e\u4ee5\u4e0a\u7684\u53c2\u6570\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<p>c\u3001\u91cd\u542fminidlna\u670d\u52a1<br \/>\nsudo \/etc\/init.d\/minidlna force-reload \u00a0 \u00a0 \u00a0 \u5982\u679c\u53d1\u73b0\u6ca1\u6709\u663e\u793a\u51fa\u6587\u4ef6\uff0c\u53ef\u4ee5\u6267\u884c\u5b83\uff1b<\/p>\n<p><strong>\u5341\u4e00\u3001USB\u6444\u50cf\u5934WEB\u754c\u9762\u89c6\u9891<\/strong><\/p>\n<p>sudo apt-get install motion<br \/>\nsudo vim \/etc\/motion\/motion.conf<\/p>\n<p>Daemon = on \u914d\u7f6e\u7684\u65f6\u5019\u6539\u6210off<br \/>\nwebcam_localhost = off<br \/>\nwebcam_port 8082 #\u9ed8\u8ba48081\u4e0d\u4fee\u6539\u51fa\u73b0\u65e0\u6cd5\u8bbf\u95ee<br \/>\nsudo vim \/etc\/default\/motion<\/p>\n<p>start_motion_daemon=yes #\u5f00\u673a\u81ea\u52a8\u8fd0\u884c<br \/>\nsudo \/etc\/init.d\/motion start<br \/>\nsudo du -h \/tmp\/motion\/ #\u8fd9\u4e2a\u76ee\u5f55\u4ea7\u751f\u597d\u591a\u7167\u7247<br \/>\nsudo netstat -anl |grep 8082 #\u67e5\u770b<br \/>\nhttp:\/\/192.168.0.36:8082 #\u8bbf\u95ee\u89c6\u9891\u76d1\u63a7\u753b\u9762<\/p>\n<p>\u5982\u4f55\u501f\u52a9Motion\u64cd\u63a7Linux\u76d1\u63a7\u6444\u50cf\u5934\uff1ahttp:\/\/os.51cto.com\/art\/201407\/445709.htm<\/p>\n<p><strong>\u5341\u4e8c\u3001\u9632\u6b62\u91cd\u542f\u81ea\u52a8\u6e05\u7a7atmp<\/strong><\/p>\n<p>vim \/etc\/default\/rcS<br \/>\nTMPTIME=0 \u6539\u6210TMPTIME=7 \u4e00\u5468\u6e05\u7406\u4e00\u6b21<br \/>\nTMPTIME=-1 \u6c38\u8fdc\u4e0d\u81ea\u52a8\u6e05\u7406<\/p>\n<p><strong>\u5341\u4e09\u3001\u8fc5\u96f7\u8fdc\u7a0b\u4e0b\u8f7d<\/strong><\/p>\n<p>Linux\u73af\u5883\u4e0b\u4f7f\u7528\u8fc5\u96f7\u4e0b\u8f7d\uff08Xware\uff09\uff1ahttp:\/\/my.oschina.net\/u\/1382972\/blog\/285129<br \/>\nLinux(x86)\u4e0b\u5b89\u88c5\u6559\u7a0b\uff0c\u4ee5\u53cainit.d\u670d\u52a1\u811a\u672c\uff0c\u53ef\u81ea\u542f\u52a8\uff1ahttp:\/\/luyou.xunlei.com\/thread-3290-1-1.html<\/p>\n<p><strong>\u5341\u56db\u3001\u4fee\u6539\u65f6\u533a<\/strong><\/p>\n<p>\u9ed8\u8ba4\u65f6\u533a\u662fEtc\/UTC\uff0c\u548c\u6211\u4eec\u7684\u5317\u4eac\u65f6\u95f4\u76f8\u5dee8\u4e2a\u65f6\u533a\uff0c\u9700\u8981\u4fee\u6539\u7cfb\u7edf\u7684\u65f6\u533a\uff0c\u4ee5\u4e0b\u6709\u4e24\u79cd\u7b80\u5355\u65b9\u5f0f\u4fee\u6539\u7cfb\u7edf\u65f6\u533a:<br \/>\n1.\u4f7f\u7528\u547d\u4ee4\u884c\u4ea4\u4e92\u754c\u9762\u4fee\u6539.<br \/>\nsudo dpkg-reconfigure tzdata<br \/>\n\u9009\u62e9\u76f8\u5e94\u7684\u65f6\u533a.<br \/>\n2.\u4fee\u6539\/etc\/timezone\u6587\u4ef6<br \/>\nvi \/etc\/timezone<br \/>\n\u628aEtc\/UTC\u6539\u6210Asia\/Shanghai\uff0c\u7136\u540e\u4fdd\u5b58(:wq)\uff0c\u91cd\u542f\u673a\u5668.<\/p>\n<p><strong>\u5341\u4e94\u3001crontab\u8bbe\u7f6e<\/strong><\/p>\n<p>*\/1 * * * * SHELL=\/bin\/bash DISPLAY=:0.0 \/home\/test.sh<\/p>\n<p><strong>\u5341\u516d\u3001\u767e\u5ea6\u4e91<\/strong><\/p>\n<p>\u4e0b\u8f7d\u5b89\u88c5\u5305\uff1ahttps:\/\/github.com\/LiuLang\/bcloud-packages<\/p>\n<p>\u5b89\u88c5\u547d\u4ee4\uff1adpkg -i file.deb \uff0c\u4f1a \u63d0\u793a\u9700\u8981\u5b89\u88c5python\uff0c\u6309\u7167\u63d0\u793a\u5b89\u88c5\u5c31\u53ef\u4ee5\u4e86\uff1b<\/p>\n<p><strong>\u5341\u4e03\u3001\u6d41\u91cf\u76d1\u63a7<\/strong><\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"UAKsDJdTv8\"><p><a href=\"https:\/\/www.datarelab.com\/blog\/Technical_literature\/434.html\">Linux VPS\u6d41\u91cf\u67e5\u770b\/\u76d1\u6d4b\u5de5\u5177 -- vnStat<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"\u300a Linux VPS\u6d41\u91cf\u67e5\u770b\/\u76d1\u6d4b\u5de5\u5177 -- vnStat \u300b\u2014\u6570\u636e\u6062\u590d\u5b9e\u9a8c\u5ba4 Data Recovery Laboratory\" src=\"https:\/\/www.datarelab.com\/blog\/Technical_literature\/434.html\/embed#?secret=1BTVGhzWjM#?secret=UAKsDJdTv8\" data-secret=\"UAKsDJdTv8\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p><strong>\u5341\u516b\u3001SVN<\/strong><\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"fsy4RrYTkd\"><p><a href=\"https:\/\/www.datarelab.com\/blog\/Technical_literature\/547.html\">Ubuntu Server\u642d\u5efasvn\u670d\u52a1\u4ee5\u53ca\u8fc1\u79fb\u65b9\u6cd5<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"\u300a Ubuntu Server\u642d\u5efasvn\u670d\u52a1\u4ee5\u53ca\u8fc1\u79fb\u65b9\u6cd5 \u300b\u2014\u6570\u636e\u6062\u590d\u5b9e\u9a8c\u5ba4 Data Recovery Laboratory\" src=\"https:\/\/www.datarelab.com\/blog\/Technical_literature\/547.html\/embed#?secret=EGyNLV68pZ#?secret=fsy4RrYTkd\" data-secret=\"fsy4RrYTkd\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p><strong>\u5341\u4e5d\u3001\u4fee\u6539ssh\u7aef\u53e3\u53f7<\/strong><br \/>\n\/etc\/ssh\/sshd_config \u5c06Port 22\u8fd9\u4e00\u884c\u53d6\u6d88\u6ce8\u91ca\uff0c\u6539\u6210\u81ea\u5b9a\u4e49\u7684\u5373\u53ef\u3002\u6ce8\u610f\u522b\u5fd8\u4e86\u4fee\u6539iptable\u9632\u706b\u5899\u8bbe\u7f6e\u3002<br \/>\n\u81ea\u5b9a\u4e49\u7aef\u53e3\u9009\u62e9\u5efa\u8bae\u5728\u4e07\u4f4d\u7684\u7aef\u53e3\uff08\u5982\uff1a10000-65535\u4e4b\u95f4\uff09<br \/>\n\u91cd\u542f ssh \u547d\u4ee4\uff1aservice sshd restart<\/p>\n<p><strong>\u4e8c\u5341\u3001Linux \u7cfb\u7edf\u5b9e\u65f6\u76d1\u63a7\u7684\u745e\u58eb\u519b\u5200 \u2014\u2014 Glances \uff08Ubuntu\u4e0a\u76ee\u524d\u8fd8\u6ca1\u6709\u5b89\u88c5\uff09<\/strong><\/p>\n<p>\u8bd1\u6587\uff1ahttps:\/\/linux.cn\/article-2782-1.html<\/p>\n<p>\u539f\u6587\uff1ahttp:\/\/www.tecmint.com\/glances-an-advanced-real-time-system-monitoring-tool-for-linux\/<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>OpenWRT Chaos Calmer 15.05<\/strong><\/p>\n<p>\u5b89\u88c5\u4e2d\u6587<br \/>\nopkg update<br \/>\nopkg install luci-i18n-base-zh-cn luci-i18n-commands-zh-cn luci-i18n-diag-core-zh-cn luci-i18n-firewall-zh-cn<\/p>\n<p>pptp\u5916\u62e8\u5931\u8d25\u7684\u89e3\u51b3\u529e\u6cd5<br \/>\nopkg install kmod-nf-nathelper-extra<\/p>\n<p>\u914d\u7f6e PPTP(VPN\u5ba2\u6237\u7aef)<\/p>\n<p>opkg update<br \/>\nopkg install ppp-mod-pptp<br \/>\nopkg install luci-proto-ppp<\/p>\n<p>\u7f16\u8f91 \/etc\/config\/network \u6587\u4ef6\uff0c\u6dfb\u52a0\u5982\u4e0b\u5185\u5bb9<br \/>\nconfig 'interface' 'vpn'<br \/>\noption 'proto' 'pptp'<br \/>\noption 'ifname' 'vpn'<br \/>\noption 'username' 'vpnuser'<br \/>\noption 'password' 'vpnpass'<br \/>\noption 'server' 'vpn.example.org'<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u8bbe\u7f6eroot\u5bc6\u7801 1.\u5728\u7ec8\u7aef\u952e\u5165sudo passwd\uff1b 2.\u4f1a\u63d0\u793a\u4f60\u8981\u8f93\u5165\u5f53\u524d\u7528\u6237\u5bc6\u7801\uff0c\u6309\u7167\u63d0\u793a\u8f93\u5165\uff0c\u56de [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[14,150],"class_list":["post-515","post","type-post","status-publish","format-standard","hentry","category-Technical_literature","tag-linux","tag-ubuntu"],"views":1596,"_links":{"self":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/posts\/515","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/comments?post=515"}],"version-history":[{"count":0,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/posts\/515\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/media?parent=515"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/categories?post=515"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/tags?post=515"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}