Linux初心者がCentOS7の初期設定をしてみた

概要

開発用サーバーとしてVPSを借りたので1からセットアップをする必要があったので、メモ程度にやった事を書いていく。

環境の確認

まずは、しっかりLinuxがインストールされているか確認する。

OS

はいOK

ディスク

SSD 50GBもしっかり認識されている。

やった事

rootのパスワードを設定

OSをインストールした直後のユーザーはrootしか存在しない。
rootは何でも出来るユーザーなので、しっかりとパスワードを設定しておく必要がある。

次のコマンドを打って、新しいパスワードと確認の再入力を済ませたら設定完了。

 
passwdはユーザーのパスワードを変更するコマンド。
本来であれば passwd hogeuser のようにユーザーを指定するが、指定がなければrootのパスワードを変更出来るようだ。

root権限のsudoが扱える一般ユーザーの追加

rootは作業するユーザーにあまり適してない。何でも出来るユーザーなので操作ミスの防止や、毎回ログインすることによるセキュリティ上の問題があるためらしい。
そこで一般ユーザーを使用するのが望ましいとのことだが、ただユーザーを作成するだけではroot権限のsudoが出来ないので以下の手順が必要となる。

まずは一般ユーザーを追加

 
続いてパスワードも設定。

 
確認の為にユーザー一覧を見てみる。

ユーザーがいっぱい表示されたが、testuserが一番下にあったのでしっかりと出来ているようだ。
あとは実際にそのユーザーでログインしてOK。

このユーザーでsudoが出来るよう設定するので、再度rootでログインする。

suはユーザーを変更するコマンドで、su [ユーザー名]でそのユーザーにログイン出来る。
ユーザー名を指定しなければrootのログインを試みる。

次は、usermodコマンドで追加した一般ユーザーをwheelグループに所属させる。
wheelグループはsudo出来る権限を持ったグループのようだ。

usermodは、ユーザーを設定するコマンドで、-Gオプションを付与することで、ユーザーの所属グループを変更するといった命令になる。

確認のため、getentコマンドでwheelグループのユーザーを表示する。

これでtestuserがwheelグループに所属している事が確認できた。

先ほどwheelグループはsudo出来る権限を持ったグループと説明したが、どうやらデフォルトではsudoが無効化されているらしい。
なので、visudoコマンドでsudoを出来るように設定する必要あるようだ。

以下の記述を見つけてコメントアウトを外すだけ。

ちなみに#が付いているとコメントアウトという事になる。

の部分は、おそらくwheel権限にsudoを付与するといった設定のようだ。

これらの設定で追加したユーザー(testuser)はsudoが出来るようになったと思われるので、
testuserにログインしてsudoを試してみる。

rootから一般ユーザーへのアカウントの変更はパスワードを問われないようだ。

sudoを確認するコマンドは、root権限のみ可能なものを実行すれば何でも良い。sudo出来ない新しいユーザーが欲しかったのでuseraddで確認してみた。
最初はsudoなしで実行

権限が無いですよと怒られた。

今度はsudoで実行してみる。

今度はパスワードを聞かれた。今ログインしている一般ユーザーのパスワードを入力したら、ユーザー追加が出来た。一度だけパスワードを入力すれば、次からパスワードを聞かれなくなる仕様のようだ。(設定出来る?)
再ログインすれば、また聞かれると思う。

これでsudoの設定終わり。

yumでパッケージのアップデート

現在インストールされているパッケージは古い可能性があるので、とりあえず各パッケージをアップデートする。
まずは、アップデートのチェックをする。

大量のアップデート可能なパッケージが表示された。

せっかくなので、さっき作成したtestuserでログインしてsudoでyum updateする。

インストールしますか?的なことが聞かれたのでyで応答。

しばらく待つとComplete!のメッセージが表示されたので、無事アップデートが終わったようだ。

まだ色々設定したい事があるが、今日はここまで~~~

感想

  • 真面目にLinux触ったのが初めてだったので結構勉強に
  • まだまだ初期設定の段階が続きそう。
  • Linux関連って結構調べやすい。

1,540 件のコメント

  • Priligy Doesn’T Work Amoxicillin Clavulanic Acid Side Effects Cephalexin Diarrhea Should I Be Worried cialis Buy Sildenafil Citrate 100mg Online Secure Drug Shop

  • Simply want to say your article is as astounding. The
    clearness in your post is just excellent and i could assume you’re
    an expert on this subject. Fine with your permission let me to grab your
    feed to keep up to date with forthcoming post. Thanks a
    million and please carry on the enjoyable work.

  • I believe everything wrote made a ton of sense.
    But, what about this? what if you composed a catchier post title?

    I mean, I don’t want to tell you how to run your website,
    but what if you added a post title to possibly grab people’s attention? I mean Linux初心者がCentOS7の初期設定をしてみた | ラバドンキャップ is kinda plain.
    You ought to look at Yahoo’s front page and
    note how they write news titles to grab people interested.
    You might add a video or a related pic or
    two to grab people excited about what you’ve got to say.
    Just my opinion, it could bring your website a little livelier.

  • Do you have a spam problem on this blog; I also am a blogger, and I was wondering your situation; many of us have created some nice methods and we are looking to exchange strategies with
    others, be sure to shoot me an e-mail if interested.

  • Hi, i read your blog from time to time and i own a similar one and
    i was just wondering if you get a lot of
    spam feedback? If so how do you protect against
    it, any plugin or anything you can advise? I get so much lately it’s driving me mad so any help is very much appreciated.

  • We stumbled over here different website and thought I might check things out.
    I like what I see so now i’m following you. Look forward to looking at your web
    page again.

  • I’m not sure where you’re getting your information, but great topic.

    I needs to spend some time learning more or understanding more.
    Thanks for wonderful information I was looking for this information for my
    mission.

  • Kamagra Online Bestellen Ohne Rezept Legitimate Online Pharmacies India Buy Synthroid Online Without Script Acquisto Viagra Originale On Line

  • Hey there! This is kind of off topic but I need some guidance from an established blog.

    Is it tough to set up your own blog? I’m not very techincal but I can figure
    things out pretty fast. I’m thinking about creating
    my own but I’m not sure where to begin. Do you have any tips or suggestions?

    Thanks

  • you’re in reality a just right webmaster. The site loading pace is incredible.
    It sort of feels that you’re doing any distinctive trick.
    In addition, The contents are masterwork. you have done a wonderful job on this
    matter!

  • I think this is among the most important info for me.
    And i’m glad reading your article. But want to remark
    on some general things, The web site style is perfect, the articles is really great : D.
    Good job, cheers

  • I truly love your blog.. Very nice colors & theme.

    Did you make this site yourself? Please reply back as I’m planning to create my own blog and would
    love to learn where you got this from or just what the theme is called.
    Cheers!

  • Hello there I am so excited I found your site, I really found you by mistake, while
    I was searching on Askjeeve for something else,
    Nonetheless I am here now and would just like to say cheers for
    a marvelous post and a all round enjoyable blog (I also love the theme/design), I don’t have time to look over it all at the minute but I
    have book-marked it and also included your RSS feeds, so
    when I have time I will be back to read a great deal more, Please do
    keep up the superb jo.

  • This design is wicked! You most certainly know how to keep
    a reader amused. Between your wit and your videos, I was almost moved to start my
    own blog (well, almost…HaHa!) Great job. I really enjoyed what you had to say,
    and more than that, how you presented it. Too cool!

  • I like the valuable information you provide in your articles.

    I will bookmark your blog and check again here frequently.
    I am quite sure I will learn many new stuff right here!
    Best of luck for the next!

  • It’s perfect time to make a few plans for the longer term and it’s time
    to be happy. I have read this publish and if I may just I
    want to recommend you some attention-grabbing things or suggestions.
    Perhaps you could write next articles relating to this article.

    I desire to learn more things about it!

  • Fantastic goods from you, man. I’ve keep in mind your stuff previous to and you’re just extremely fantastic.

    I actually like what you’ve bought here, certainly like
    what you are saying and the way by which you are
    saying it. You make it entertaining and you still care for to stay it wise.
    I can’t wait to learn much more from you. That is really a tremendous site.

  • Undeniably believe that which you stated. Your
    favorite justification seemed to be on the web the simplest thing to be aware of.
    I say to you, I definitely get irked while people think about
    worries that they just don’t know about. You managed to hit the nail upon the top as well
    as defined out the whole thing without having side effect , people can take a signal.
    Will probably be back to get more. Thanks

  • Hello! I could have sworn I’ve been to this blog before but after reading through some of the post I realized it’s new to me.
    Nonetheless, I’m definitely happy I found it and I’ll
    be bookmarking and checking back often!

  • We are a gaggle of volunteers and opening a new scheme in our community.
    Your site provided us with valuable information to work on.
    You have performed a formidable activity and our entire neighborhood will be thankful to you.

  • Undeniably believe that that you said. Your favourite
    justification seemed to be on the internet the easiest factor to take into account
    of. I say to you, I definitely get annoyed at the same time as
    people consider issues that they just don’t recognise about.
    You controlled to hit the nail upon the top and also outlined out
    the whole thing without having side-effects , other folks could take a signal.
    Will likely be again to get more. Thanks

  • Simply desire to say your article is as amazing.
    The clarity to your put up is simply nice and i can assume
    you are knowledgeable on this subject. Well along with
    your permission let me to seize your feed to keep updated with impending post.
    Thank you a million and please carry on the rewarding work.

  • Hello, i read your blog from time to time and i own a similar one and i was just wondering if you get
    a lot of spam comments? If so how do you stop it, any plugin or anything you can advise?

    I get so much lately it’s driving me crazy so any support is very much appreciated.

  • Magnificent beat ! I would like to apprentice while you amend your web site, how could i subscribe for a
    blog website? The account aided me a acceptable deal. I had been tiny bit acquainted of this your broadcast provided bright clear idea

  • Thank you for the auspicious writeup. It in reality was
    once a enjoyment account it. Glance advanced to far added agreeable from you!
    By the way, how can we keep up a correspondence?

  • Excellent beat ! I would like to apprentice while you amend
    your site, how can i subscribe for a blog website?
    The account helped me a acceptable deal. I had been a little bit acquainted of this your broadcast offered bright clear idea

  • Have you ever considered publishing an e-book or guest authoring on other
    sites? I have a blog centered on the same information you discuss and would love to have you share some stories/information. I
    know my visitors would value your work. If you’re even remotely
    interested, feel free to send me an e mail.

  • Great goods from you, man. I have understand your stuff previous to and
    you’re just too excellent. I actually like what you have
    acquired here, really like what you’re saying and the way in which you say it.

    You make it entertaining and you still take care of to keep it wise.
    I cant wait to read far more from you. This is actually a
    great site.

  • you’re truly a good webmaster. The website loading speed
    is amazing. It sort of feels that you are doing any unique trick.

    Also, The contents are masterpiece. you’ve done a wonderful task in this topic!

  • Do you have a spam problem on this blog; I also am a blogger,
    and I was curious about your situation; many of us have developed some nice practices and we are looking to trade
    methods with others, please shoot me an email if interested.

  • Hey there! Someone in my Facebook group shared this site with
    us so I came to take a look. I’m definitely enjoying the information. I’m book-marking and will be tweeting this to my followers!

    Excellent blog and fantastic style and design.

  • This is very interesting, You’re a very skilled blogger.

    I have joined your rss feed and look forward to seeking more of your excellent post.
    Also, I have shared your site in my social networks!

  • Does your blog have a contact page? I’m having trouble locating it but, I’d
    like to shoot you an email. I’ve got some creative ideas for your blog you might be interested in hearing.
    Either way, great site and I look forward to seeing it grow over time.

  • I’m very happy to find this page. I want to to thank you for your time for this particularly wonderful read!!

    I definitely enjoyed every bit of it and I have you book marked to check out new things in your website.

  • This is very interesting, You’re a very skilled blogger. I’ve joined your feed and look forward to seeking more of your great post. Also, I have shared your website in my social networks!

  • Fantastic goods from you, man. I have understand your stuff previous
    to and you are just too wonderful. I actually like what you have acquired here, certainly
    like what you’re saying and the way in which you say it.
    You make it entertaining and you still take care of
    to keep it smart. I can not wait to read far
    more from you. This is actually a terrific website.

  • Hi there, I discovered your blog by the use of Google at the same time as searching for a
    related topic, your web site came up, it looks great. I have bookmarked it in my google bookmarks.

    Hi there, just become alert to your weblog through Google,
    and found that it is truly informative. I’m going to watch out for brussels.
    I’ll be grateful in case you continue this in future.
    Many folks might be benefited out of your writing. Cheers!

  • Simply desire to say your article is as astonishing. The clearness in your
    post is simply spectacular and i can assume you’re an expert on this
    subject. Fine with your permission let me to grab your RSS feed to
    keep up to date with forthcoming post. Thanks a million and please continue the enjoyable work.

  • Hmm is anyone else encountering problems with the pictures on this blog loading?
    I’m trying to find out if its a problem on my end or if it’s the blog.
    Any suggestions would be greatly appreciated.

  • I’m amazed, I must say. Seldom do I encounter a blog that’s equally educative and
    entertaining, and let me tell you, you’ve hit the nail on the head.
    The issue is something which not enough men and women are speaking intelligently about.
    I am very happy I found this in my hunt for something regarding this.

  • With havin so much written content do you ever run into any
    problems of plagorism or copyright violation? My
    website has a lot of unique content I’ve either written myself or outsourced but it seems a lot of
    it is popping it up all over the internet
    without my agreement. Do you know any ways to help protect against content from being ripped off?
    I’d certainly appreciate it.

  • you are actually a just right webmaster. The web site loading
    pace is amazing. It seems that you are doing any distinctive trick.
    In addition, The contents are masterpiece. you have done a wonderful process in this topic!

  • I believe this is among the most important information for me.
    And i’m happy reading your article. But wanna statement on some general
    things, The website taste is perfect, the articles is really excellent :
    D. Just right process, cheers

  • Wow that was unusual. I just wrote an incredibly long comment but after I clicked submit my comment didn’t show up.

    Grrrr… well I’m not writing all that over again. Anyhow, just wanted to say fantastic blog!

  • Hello, i read your blog occasionally and i own a similar one and i was just wondering if you get a lot of spam
    remarks? If so how do you prevent it, any plugin or anything you
    can advise? I get so much lately it’s driving me
    mad so any assistance is very much appreciated.

  • I do agree with all the concepts you have presented on your post.

    They’re really convincing and will certainly work. Nonetheless, the posts are very short for beginners.
    May you please prolong them a bit from subsequent time? Thanks for the post.

  • Hello! I just wanted to ask if you ever have any issues with hackers?
    My last blog (wordpress) was hacked and I ended up losing
    several weeks of hard work due to no data backup.

    Do you have any solutions to prevent hackers?

  • Greetings! Very helpful advice in this particular post!
    It is the little changes that produce the most significant changes.
    Thanks for sharing! natalielise pof

  • Hi! I could have sworn I’ve visited this website before but after looking at some
    of the articles I realized it’s new to me. Nonetheless, I’m definitely delighted I came across it
    and I’ll be bookmarking it and checking back often! natalielise plenty of fish

  • Greetings, I do believe your blog could possibly be having internet browser compatibility problems.
    Whenever I look at your blog in Safari, it looks fine however, if opening in IE, it has
    some overlapping issues. I simply wanted to give you a quick heads up!
    Aside from that, fantastic site!

  • Definitely believe that which you said. Your favorite reason appeared to be on the internet the easiest thing to be aware of. I say to you, I definitely get annoyed while people consider worries that they just do not know about. You managed to hit the nail upon the top and also defined out the whole thing without having side-effects , people can take a signal. Will likely be back to get more. Thanks

  • Have you ever thought about adding a little
    bit more than just your articles? I mean, what you say is valuable and everything.
    But think about if you added some great pictures or video
    clips to give your posts more, “pop”! Your content is excellent but with
    pics and video clips, this website could undeniably be one of the
    greatest in its niche. Good blog!

  • You actually make it seem so easy with your presentation but I find this matter to be
    really something that I think I would never understand. It seems too
    complex and very broad for me. I am looking forward for your next post, I’ll try to get the hang of it!

  • Admiring the commitment you put into your blog and detailed information you offer.
    It’s awesome to come across a blog every once in a while that isn’t the same unwanted rehashed material.
    Wonderful read! I’ve saved your site and I’m adding your
    RSS feeds to my Google account.

  • Thanks for one’s marvelous posting! I definitely enjoyed reading
    it, you happen to be a great author.I will be sure to bookmark your blog and may
    come back very soon. I want to encourage you
    continue your great writing, have a nice holiday weekend!
    natalielise pof

  • Nice post. I used to be checking continuously this weblog and I am inspired!
    Extremely useful info specially the ultimate part 🙂 I care
    for such information much. I was looking for this particular info for a long time.
    Thanks and good luck. pof natalielise

  • Its like you read my mind! You appear to know a lot about this, like you wrote the book in it or
    something. I think that you can do with some pics to drive the message home
    a bit, but instead of that, this is fantastic blog. A great read.
    I will definitely be back.

  • It is altogether amazing that today I was looking appropriate for something to submit me a jerk of happiness. The outlandish hang-up is that I set up it in the senior place. I was struggling to make money to get in touch with my hire paid, and I could not figure forbidden what to do. Some friends gave me a occasional special options, but I noiseless was not dedicated to those solutions. However, I irrevocably figured out that I just needed to reserve a look at this website to resolve all my problems: payday loans online

  • Fantastic goods from you, man. I’ve keep in mind your stuff previous to and you’re
    just extremely fantastic. I really like what you’ve
    acquired right here, certainly like what you’re saying and the way in which you are saying it.
    You make it enjoyable and you still care for to
    keep it smart. I cant wait to learn far more from you.
    This is actually a wonderful site.

  • Hey would you mind stating which blog platform you’re
    using? I’m planning to start my own blog soon but I’m having a tough time making a
    decision between BlogEngine/Wordpress/B2evolution and
    Drupal. The reason I ask is because your design seems different then most blogs and
    I’m looking for something completely unique. P.S My apologies for being
    off-topic but I had to ask!

  • Hey there! I just wanted to ask if you ever have any problems with
    hackers? My last blog (wordpress) was hacked and I ended up losing a few months of hard work due to no
    data backup. Do you have any methods to stop hackers?

  • Hi, I do believe this is a great blog. I stumbledupon it ;
    ) I will come back once again since i have book marked it.

    Money and freedom is the best way to change, may you be rich and
    continue to guide others.

  • At this time it appears like Expression Engine is
    the top blogging platform out there right now. (from what I’ve
    read) Is that what you are using on your blog?

  • I’m really enjoying the design and layout of your site. It’s
    a very easy on the eyes which makes it much more enjoyable for me to come here and visit more often. Did you hire out a developer to create your theme?
    Superb work!

  • Howdy! This blog post couldn’t be written any better!
    Going through this article reminds me of my previous roommate!
    He constantly kept preaching about this. I am going to send this post to him.
    Pretty sure he will have a good read. Thanks for sharing!

  • I was having trouble figuring wrong what I should to do. I tried so many other things in the future I came to a terminal conclusion. My ally and I were talking equal era, and it whip me out-moded of nowhere. I out of the blue realized that I heard of a website some spell ago that would stop me out. I came on here because I wanted to share my mind-blowing invention with you all. Here it is: personal loans online no credit check

  • My brother recommended I might like this web site. He was totally right.
    This post truly made my day. You cann’t imagine just how much time I had spent for this information! Thanks!

  • I’d like to thank you for the efforts you have put in writing this website.
    I really hope to view the same high-grade blog posts
    from you in the future as well. In truth, your creative writing abilities has inspired me to get my very own site now 😉

  • you are actually a excellent webmaster. The site loading pace is amazing. It sort of feels that you are doing any unique trick. Also, The contents are masterwork. you have performed a wonderful process in this topic!

  • Have you ever considered creating an ebook or guest authoring on other blogs?
    I have a blog based on the same subjects you discuss and
    would love to have you share some stories/information. I know my viewers would value your
    work. If you’re even remotely interested, feel free to send
    me an email.

  • How are you guys doing? I’m so excited that I finally found a concede to update my happiness. I had been broken-hearted for rather some era until I ground out of the closet this redone secret. It’s a undeniably fun way respite c start delight points instantly. Well, here it is: http://onlinecasinoforrealmoney.us.org/

  • I was wondering if you ever thought of changing the layout of
    your site? Its very well written; I love what youve got to say.
    But maybe you could a little more in the way of content so people could connect
    with it better. Youve got an awful lot of text for only having 1 or 2 pictures.
    Maybe you could space it out better?

  • I haven’t checked in here for a while since I thought it was getting boring, but the last several posts are great quality so I guess I will add you back to my everyday bloglist. You deserve it my friend ??

  • Today, I went to the beachfront with my children. I found a sea shell
    and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She
    placed the shell to her ear and screamed. There was a hermit crab inside and it pinched her ear.
    She never wants to go back! LoL I know this is totally off topic but I had to tell
    someone!

  • Hi! Someone in my Facebook group shared this site with us so I came to check it out.
    I’m definitely enjoying the information. I’m bookmarking and will be
    tweeting this to my followers! Fantastic blog and wonderful design and style.

  • I have read some excellent stuff here. Certainly worth bookmarking for revisiting.
    I surprise how so much effort you set to create the
    sort of fantastic informative website.

  • It’s really a cool and useful piece of information.
    I’m happy that you simply shared this helpful info
    with us. Please keep us informed like this. Thank you for sharing.

  • Someone essentially help to make seriously articles I’d state.
    That is the very first time I frequented your website page and thus far?
    I amazed with the analysis you made to make this particular post amazing.
    Wonderful process!

  • Only wanna comment on few general things, The website design and style is perfect, the written content is real great. “To the artist there is never anything ugly in nature.” by Franois Auguste Ren Rodin.

  • I was wondering if you ever thought of changing the layout of your blog?
    Its very well written; I love what youve got to say.
    But maybe you could a little more in the way of content so people could connect with it better.
    Youve got an awful lot of text for only having 1 or two images.

    Maybe you could space it out better?

  • Currently it sounds like Expression Engine is the best blogging platform available right now.

    (from what I’ve read) Is that what you’re using on your blog?

  • Wow, superb weblog format! How long have you been running a blog for?
    you make blogging glance easy. The whole glance of your site is
    fantastic, as neatly as the content!

  • Today, I went to the beach with my children. I found a sea shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She put the shell to her ear and screamed. There was a hermit crab inside and it pinched her ear. She never wants to go back! LoL I know this is totally off topic but I had to tell someone!

  • Sweet blog! I found it while surfing around on Yahoo
    News. Do you have any suggestions on how to get
    listed in Yahoo News? I’ve been trying for a while but I never seem
    to get there! Thank you

  • Hello! Quick question that’s entirely off topic. Do you know how to make your site mobile friendly? My weblog looks weird when browsing from my iphone4. I’m trying to find a theme or plugin that might be able to correct this problem. If you have any recommendations, please share. Appreciate it!

  • Attractive section of content. I just stumbled upon your weblog and in accession capital to assert that I acquire actually enjoyed account your blog posts. Anyway I will be subscribing to your augment and even I achievement you access consistently quickly.

  • Greetings! Quick question that’s entirely off topic.
    Do you know how to make your site mobile friendly? My web site looks weird
    when viewing from my apple iphone. I’m trying to find a template
    or plugin that might be able to fix this problem.
    If you have any suggestions, please share. Thank you!

  • Howdy very nice site!! Man .. Excellent .. Amazing ..
    I will bookmark your web site and take the feeds also? I’m happy to seek out numerous useful info right
    here in the post, we want work out more strategies on this regard,
    thank you for sharing. . . . . .

  • My brother recommended I might like this blog. He was totally right.
    This post actually made my day. You can not imagine simply how much time I had spent for this information! Thanks!

  • Hi, I think your blog might be having browser compatibility issues.
    When I look at your blog site in Firefox, it looks fine but
    when opening in Internet Explorer, it has some overlapping.
    I just wanted to give you a quick heads up!
    Other then that, great blog!