LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-27-2015, 08:24 AM   #1
dunnery
Member
 
Registered: May 2010
Location: East Stroudsburg
Distribution: Debian Jessie
Posts: 222

Rep: Reputation: 8
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.
 
Old 04-27-2015, 09:26 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,842

Rep: Reputation: 756Reputation: 756Reputation: 756Reputation: 756Reputation: 756Reputation: 756Reputation: 756
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.
 
2 members found this post helpful.
Old 04-27-2015, 09:32 AM   #3
dunnery
Member
 
Registered: May 2010
Location: East Stroudsburg
Distribution: Debian Jessie
Posts: 222

Original Poster
Rep: Reputation: 8
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?
 
Old 04-27-2015, 09:38 AM   #4
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
'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'.
 
Old 04-27-2015, 10:12 AM   #5
dunnery
Member
 
Registered: May 2010
Location: East Stroudsburg
Distribution: Debian Jessie
Posts: 222

Original Poster
Rep: Reputation: 8
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?
 
Old 04-27-2015, 10:18 AM   #6
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Read this page about SSH on Wikipedia.
 
Old 04-27-2015, 10:33 AM   #7
dunnery
Member
 
Registered: May 2010
Location: East Stroudsburg
Distribution: Debian Jessie
Posts: 222

Original Poster
Rep: Reputation: 8
ha ha. i need a degree in nasa to understand that. i guess ill have to forget about ssh
 
Old 04-27-2015, 10:50 AM   #8
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Search the web for 'openssh tutorial'. You don't need a Degree to use it though.
 
Old 04-27-2015, 11:10 AM   #9
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,552

Rep: Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112
Quote:
Originally Posted by dunnery View Post
is a remote server simply another computer? in this case his computer?
Yes

Quote:
Originally Posted by dunnery View Post
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.
 
Old 04-27-2015, 04:20 PM   #10
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,842

Rep: Reputation: 756Reputation: 756Reputation: 756Reputation: 756Reputation: 756Reputation: 756Reputation: 756
Quote:
Originally Posted by dunnery View Post
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.
 
Old 04-27-2015, 07:53 PM   #11
dunnery
Member
 
Registered: May 2010
Location: East Stroudsburg
Distribution: Debian Jessie
Posts: 222

Original Poster
Rep: Reputation: 8
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
 
Old 04-27-2015, 08:04 PM   #12
dunnery
Member
 
Registered: May 2010
Location: East Stroudsburg
Distribution: Debian Jessie
Posts: 222

Original Poster
Rep: Reputation: 8
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.
 
Old 04-27-2015, 08:52 PM   #13
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,552

Rep: Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112
Quote:
Originally Posted by dunnery View Post
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.

Last edited by suicidaleggroll; 04-27-2015 at 08:57 PM.
 
Old 04-27-2015, 09:48 PM   #14
dunnery
Member
 
Registered: May 2010
Location: East Stroudsburg
Distribution: Debian Jessie
Posts: 222

Original Poster
Rep: Reputation: 8
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.
 
Old 04-27-2015, 09:54 PM   #15
dunnery
Member
 
Registered: May 2010
Location: East Stroudsburg
Distribution: Debian Jessie
Posts: 222

Original Poster
Rep: Reputation: 8
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Is this the write way to write a 2 command loop script? Bobbyyyy Linux - Newbie 1 04-14-2014 03:03 PM
Disabling 'write command' hirenpandya Linux - Security 9 03-03-2009 06:10 PM
Write command in QT navderm Programming 1 01-04-2009 09:41 PM
how do I write a command? er20ic Linux - Newbie 9 11-08-2006 09:17 PM
How to write Invisible Command rktech83 Linux - General 1 03-09-2006 03:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration