LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   The write command (https://www.linuxquestions.org/questions/linux-newbie-8/the-write-command-4175540869/)

dunnery 04-27-2015 07:24 AM

The write command
 
I understand how to use the write command but I'm unsure about how to set up the users. If my friend in inThe uk and I'm in the USA is it possible for me to write to him via the terminal with the write command or is it only for a local network within my office?

How do I set up the people who I want to talk with via the write command? I'm looking online but everyone seems to address the question presuming the users are already set up.

smallpond 04-27-2015 08:26 AM

talk, write and wall allow multiple users logged into the same computer at the same time to communicate with each other. If your friend in the UK logs into your computer via ssh, then write would allow you to type into your terminal window and have it show up in theirs.

dunnery 04-27-2015 08:32 AM

do i have to list him as a user? im just unsure on how he logs in. what do i need to do on my end. do i make a group? whats the protocol here? how does he find my computer? whats the way to get the address?

veerain 04-27-2015 08:38 AM

'ssh' and 'rsh' allow one to login to remote system as local users are able to log in. And 'write' would posts messages there also.

'rsh' (Remote Shell) is secuirty risk.

'ssh' (Secure Shell) is secure. To enable access you have to install/setup 'OpenSSH'.

dunnery 04-27-2015 09:12 AM

thank you veerain but i dont think im being clear enough with my question. i do not understand what a remote host is? i simply have no idea what the terminolgy is.do i need an account on a remote server? i just dont get it?
i thought that i would type my friends computer ip address which is something like ssh user@235.65.43.678 and it would connect me to his computer. but obviously im way off the mark. what is the syntax for connecting to his computer? i can work it out if you give me a basic idea of the syntax.
is a remote server simply another computer? in this case his computer? or is a remote server a central point between the two computers that we have to have an account in order to communicate?

veerain 04-27-2015 09:18 AM

Read this page about SSH on Wikipedia.

dunnery 04-27-2015 09:33 AM

ha ha. i need a degree in nasa to understand that. i guess ill have to forget about ssh

veerain 04-27-2015 09:50 AM

Search the web for 'openssh tutorial'. You don't need a Degree to use it though.

suicidaleggroll 04-27-2015 10:10 AM

Quote:

Originally Posted by dunnery (Post 5353813)
is a remote server simply another computer? in this case his computer?

Yes

Quote:

Originally Posted by dunnery (Post 5353813)
i thought that i would type my friends computer ip address which is something like ssh user@235.65.43.678 and it would connect me to his computer. but obviously im way off the mark. what is the syntax for connecting to his computer? i can work it out if you give me a basic idea of the syntax.

No you're very close. There are just a few things you need to make sure of before you can connect:

1) Is 235.65.43.678 the public IP address of his computer, or is his computer behind a NAT (router, firewall, etc.) and 235.65.43.678 is the public IP of the entire network? If it's the former, you're set. If it's the latter, he'll need to add a rule in his NAT to allow incoming connections on port 22 (the default SSH port, or you/him could pick a custom port if you wish) to be forwarded to the private IP of his computer. That way the router knows "This incoming connection needs to go to that computer".

2) "user" will need to be a user account on his computer that you have the password for.

3) His computer will need to have sshd installed and running, with the necessary firewall settings to allow incoming connections.

smallpond 04-27-2015 03:20 PM

Quote:

Originally Posted by dunnery (Post 5353783)
do i have to list him as a user? im just unsure on how he logs in. what do i need to do on my end. do i make a group? whats the protocol here? how does he find my computer? whats the way to get the address?

There is command named useradd (or adduser on some systems) which will create a new login account on your computer. It takes care of the username, group, and creates a home directory. That lets your friend login using ssh from Linux or PuTTY from Windows, provided sshd is working.

dunnery 04-27-2015 06:53 PM

thanks guys. i appreciate all the help.
so for the record, heres what i have done so far.

01. I used smallponds adduser command and created a user called userb
02. i gave the account a password and verified it. (lets pretend its dabby)
03. i went to a site called whatismyip.com and i found out the ip address of my computer.

i sent my friend his user id and password and my ip address with instructions to type into the terminal ssh userb@224.54.65.221
hit enter and type 'dabby' which is his password on my machine. and then type me a message if he gets the 'go ahead'.

did I do this correctly? what else do i have to do in order to hook these up?

thanks guys

dunnery 04-27-2015 07:04 PM

im looking around the internet on how to set up ssh and its pretty diverse. there are no two ways to set up ssh. everyone has a different version. some called it ssh, some call it sshd... and very often when i follow their advice i get command not recognised. linux and programming and system admin is a deep thing. im just going to keep going until i understand it.

suicidaleggroll 04-27-2015 07:52 PM

Quote:

Originally Posted by dunnery (Post 5354141)
thanks guys. i appreciate all the help.
so for the record, heres what i have done so far.

01. I used smallponds adduser command and created a user called userb
02. i gave the account a password and verified it. (lets pretend its dabby)
03. i went to a site called whatismyip.com and i found out the ip address of my computer.

i sent my friend his user id and password and my ip address with instructions to type into the terminal ssh userb@224.54.65.221
hit enter and type 'dabby' which is his password on my machine. and then type me a message if he gets the 'go ahead'.

did I do this correctly? what else do i have to do in order to hook these up?

thanks guys

Please see my earlier post. If your computer is behind a NAT/router then you'll also need to set up a port forwarding rule in the router to push incoming connections on port 22 to your computer's private IP on your LAN. This is because your entire subnet (all of your computers, phones, TV, etc.) all shares the same public IP. When your friend tries to connect to that IP, they don't hit your computer, they hit your router. Your router then needs to know what to do with this connection. Should it go to your phone? Laptop? TV? Game console? The port forwarding rule basically says "forward any incoming connections on port 22 to this computer on the network". You can usually use "ifconfig" to see what your computer's private IP is (probably 192.168.1.x or 10.1.10.x or something similar). It would be a good idea to give your computer a static IP on your local network so it doesn't change after a reboot or power outage, this can be done on either the computer itself, or in the DHCP server (likely the router).

Quote:

Originally Posted by dunnery
im looking around the internet on how to set up ssh and its pretty diverse. there are no two ways to set up ssh. everyone has a different version. some called it ssh, some call it sshd... and very often when i follow their advice i get command not recognised. linux and programming and system admin is a deep thing. im just going to keep going until i understand it.

ssh is the client process, you use this to connect to a remote sshd server
sshd is the server daemon, this is what's sitting in the background listening for incoming connections

If you tells us what Linux distro you're using, it will make it easier to provide specific commands.

dunnery 04-27-2015 08:48 PM

wow, great info. thanks. Im using ubuntu studio, im a musician so it comes with all the music software.
ok, so I really understand the ip address and the router etc etc. I did the ifconfig and <im presuming the address i need is the wlan0?
so now i have my new ipaddress that goes straight to my computer, does this mean my fruiend in the uk can type......

ssh userb@(new ip)

hes probably asleep right now so <i wonder if theres any way i can log in as him and test it out?
thanks for the help. anything you have will be much appreciated.

dunnery 04-27-2015 08:54 PM

well it definitely logged in because the username changed to his username so i was logged in as him. THIS MIGHT WORK!!!!! ha ha
if you can give me a way to have both accounts working i can test it myself before he wakes up.


All times are GMT -5. The time now is 11:13 AM.