Hui WANG's Blog

One will, One way

Tag: server

Recevie Mails From it-sudparis With a Gmail Account

In this post, I’d like share a dirty tip with students at TELECOM SudParis  who are suffering from reading their emails with the all-in-one Gaspar. Because we have to input password every time to get connected. You may suggest using Outlook or Thunderbird, but they are just not portable. When we change computer, all configurations are lost. Here comes the fancy and life saving Gmail. No matter where we are, it allows us to read mails from all other accounts in one place, Gmail.

I take the configurations of our school mail for instance. You can certainly adapt the method to you own mail account in condition that a pop server is available. Here we go! Read the rest of this entry »

how to setup an openssh home server in ubuntu

In this simple tutorial, I am showing you how to make the openssh server accessible via distance rather than just install several binary packages.

Anyway, we should firstly get the packages installed. Fire up a terminal and hit the following command:

sudo apt-get install ssh openssh-server openssh-client

Secondly, make sure the server is working correctly

sudo /etc/init.d/ssh restart

Thirdly, check whether the port 22 which openssh server is listening on is open. A package called Nmap is needed here. Run the following command:

sudo apt-get install nmap

If your computer is behind a router, please find the its public ip first, you can find it by connecting to your router’s web interface, typically by typing 192.168.1.1 in your preferred browser. If not get it directly by hitting ifconfig in your termernal.

Right now, with the public ip, run the following command:

sudo nmap -sS -O your_public_ip

Last, if port 22 is open, everything is done. Connect to your server with this command:

ssh your_user_name@your_public_id

If not, you must have at least another ONE open port from the result of nmap, and then configure your router to forward requests on this open port to the port 22. Typically in your router configuration table, you could find an column called NAT. The picture below is showing my configuration.
ssh_nat

Ok, get connected by using this command:

ssh your_user_name@your_public_ip -p the_open_port

Please feel free to let me know if it doesn’t work for you.

What webmasters have to know about file permissions

If you are a web master and get your website hosted in a Linux environment, but you are not very familiar with the Linux things, please keep reading. I hope this post could give you a further insight of file permissions in the Triple W filed. Or at least, bring you some ideas to get your hands dirty.

Let’s get started by looking at an example which could bring us into topics directly. An index.php file is created in WhuIsPublicFiles, just read it to get more informations http://www.hui-wang.info/WhuisPublicFiles/index.php .

I am not trying to get you confused, in contrast, it is the key point to understand file permissions. So what does 700 mean ? Yes, you are 200% right by saying that only the owner of the file is able to read it and all the others can do nothing with it. However, who is the owner ? The answer is simple, it’s me. Then who are you ? YOU are my dears readers, so you are not those “others”. The principle comes like as followings.

I get my site hosted by a web server, an apache server, in my case. It is 24/24h-7/7d there to listen to your requests. As I can’t do it for you like apache, I assign all my rights to the apache server. Apache server is running as me(Attention please, it is not always like this, apache can also run as someone else). You pass it an order by typing some kind of url in your browser, and with my rights, apache server returns you what you want. In fact, it is always a program that gets things done, and every program is running as some user. For example when we edit a text file, it is the editor that is editing it and surely with our rights assigned.

To conclude, whether your visitors could read your file depends on not only the three octal digits but also whom your web server is running as. If the server is running as the owner, your visitors are the owners and if your server is running as others, your visitors becomes the others.

P.S: All  posts in this site is for purpose of exchanging opinions. You are very welcome to give us yours if you have different ones.