{"id":3447,"date":"2013-08-19T22:22:51","date_gmt":"2013-08-19T13:22:51","guid":{"rendered":"http:\/\/www.vincentina.net\/?p=3447"},"modified":"2013-08-19T22:22:51","modified_gmt":"2013-08-19T13:22:51","slug":"freebsd%e3%81%a7linux%e3%81%ae%e3%82%88%e3%81%86%e3%81%absed-i%e3%81%99%e3%82%8b%e3%81%a8%e3%82%a8%e3%83%a9%e3%83%bc%e3%81%8c%e3%81%a7%e3%81%be%e3%81%99%e3%81%ae%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.vincentina.net\/?p=3447","title":{"rendered":"FreeBSD\u3067Linux\u306e\u3088\u3046\u306bsed -i\u3059\u308b\u3068\u30a8\u30e9\u30fc\u304c\u3067\u307e\u3059\u306e\u3002"},"content":{"rendered":"<p>\u3053\u306a\u3044\u3060\u306eFreeBSD\u306e\u521d\u671f\u8a2d\u5b9a\u3092\u3001\u4f55\u6642\u305e\u3084\u306eLinux\u306e\u6700\u521d\u306b\u3053\u308c\u304f\u3089\u3044\u306f\u3084\u3063\u3068\u3051\u30b9\u30af\u30ea\u30d7\u30c8\u307f\u305f\u3044\u306b\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u3057\u3088\u3046\u3068\u601d\u3063\u3066\u3061\u3087\u3053\u3061\u3087\u3053\u4f5c\u3063\u3066\u3044\u305f\u3082\u306e\u306e\u3001sed\u3067\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u9014\u4e2d\u3067\u7d42\u308f\u3063\u3066\u305f\u306e\u3060\u3002<\/p>\n<p>\u4f55\u3060\u304b\u7a81\u7136\u3084\u308b\u6c17\u306b\u306a\u3063\u3066\u8abf\u3079\u3066\u307f\u305f\u3089\u3053\u3093\u306a\u3053\u3068\u3067\u53ef\u80fd\u306b\u306a\u3063\u305f\u3002<\/p>\n<pre>sed -i \"s\/^PermitRootLogin no\/PermitRootLogin yes\/\" \/etc\/ssh\/sshd_config\r\nsed: 1: \"\/etc\/ssh\/sshd_config\": bad flag in substitute command: 'h'<\/pre>\n<p>\u3053\u3093\u306a\u611f\u3058\u306e\u30a8\u30e9\u30fc\u306b\u306a\u3063\u3066\u3044\u305f\u306e\u3060\u304c\u3002<\/p>\n<p>&nbsp;<\/p>\n<pre>\u00a0sed -i \"\" s\/^#PermitRootLogin\\ no\/PermitRootLogin\\ yes\/g \/etc\/ssh\/sshd_config<\/pre>\n<p>\u3053\u308c\u3067\u3044\u3051\u305f\u3001\u30c0\u30d6\u30eb\u30af\u30aa\u30c6\u30fc\u30b7\u30e7\u30f3\u304c\u3044\u308b\u307f\u305f\u3044\u3002<br \/>\n\u7a7a\u767d\u306e\u524d\u306f\u5186\u30de\u30fc\u30af\u3067\u3059\u306e\u3002<br \/>\n\u305d\u308c\u3067\u306f\u5b9f\u969b\u306b\u4f7f\u3063\u3066\u307f\u3088\u3046\u3002<\/p>\n<pre>sudo cat \/etc\/ssh\/sshd_config | grep \"PermitRootLogin yes\"\r\nPermitRootLogin yes\r\nsed -i \"\" s\/PermitRootLogin\\ yes\/PermitRootLogin\\ no\/g \/etc\/ssh\/sshd_config\r\nsudo cat \/etc\/ssh\/sshd_config | grep \"PermitRootLogin no\"\r\nPermitRootLogin no<\/pre>\n<p>\u3053\u306e\u3068\u304a\u308a\u3002<br \/>\n\u3053\u3093\u306a\u611f\u3058\u3067\u3044\u3051\u3061\u3083\u3044\u307e\u3057\u305f\u3002<br \/>\n\u3053\u308c\u3067\u30b9\u30af\u30ea\u30d7\u30c8\u4f5c\u6210\u304c\u6357\u308b\u306e\u3058\u3083\u3042\u3002<\/p>\n<p>\u3057\u3070\u3089\u304f\u306f\u524d\u56de\u306b\u5f15\u304d\u7d9a\u3044\u3066\u30e6\u30fc\u30b6\u30fc\u6a29\u9650\u3067\u3067\u304d\u308b\u3082\u3093\uff01\u30b7\u30ea\u30fc\u30ba\u3092\u3084\u308d\u3046\u304b\u3068\u601d\u3063\u3066\u305f\u3051\u3069\u3001\u3084\u3063\u3071\u308a\u660e\u65e5\u306e\u98a8\u306f\u660e\u65e5\u5439\u304f\u306e\u3060\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u53c2\u8003\u30b5\u30a4\u30c8<br \/>\nMY MCP\u3000<a href=\"http:\/\/mymcp.blogspot.jp\/2012\/04\/freebsd-sed-i-error-sed-1-file-bad-flag.html\" target=\"_blank\">FreeBSD sed -i Error &#8220;sed: 1: &#8220;FILE&#8221;: bad flag in substitute command: &#8216;.&#8217; &#8220;<\/a><\/p>\n<p>&nbsp;<\/p>\n<div class='wp_social_bookmarking_light'>        <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/www.vincentina.net\/?p=3447\" data-text=\"FreeBSD\u3067Linux\u306e\u3088\u3046\u306bsed -i\u3059\u308b\u3068\u30a8\u30e9\u30fc\u304c\u3067\u307e\u3059\u306e\u3002\" data-via=\"TakekenTw\" data-lang=\"ja\">Tweet<\/a><\/div><\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u306a\u3044\u3060\u306eFreeBSD\u306e\u521d\u671f\u8a2d\u5b9a\u3092\u3001\u4f55\u6642\u305e\u3084\u306eLinux\u306e\u6700\u521d\u306b\u3053\u308c\u304f\u3089\u3044\u306f\u3084\u3063\u3068\u3051\u30b9\u30af\u30ea\u30d7\u30c8\u307f\u305f\u3044\u306b\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u3057\u3088\u3046\u3068\u601d\u3063\u3066\u3061\u3087\u3053\u3061\u3087\u3053\u4f5c\u3063\u3066\u3044\u305f\u3082\u306e\u306e\u3001sed\u3067\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u9014\u4e2d\u3067\u7d42\u308f\u3063\u3066\u305f\u306e\u3060\u3002 \u4f55\u3060\u304b\u7a81\u7136\u3084\u308b\u6c17 &hellip; <a href=\"https:\/\/www.vincentina.net\/?p=3447\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;FreeBSD\u3067Linux\u306e\u3088\u3046\u306bsed -i\u3059\u308b\u3068\u30a8\u30e9\u30fc\u304c\u3067\u307e\u3059\u306e\u3002&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-3447","post","type-post","status-publish","format-standard","hentry","category-server"],"_links":{"self":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/posts\/3447","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3447"}],"version-history":[{"count":0,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/posts\/3447\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3447"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3447"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3447"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}